LLVM 22.0.0git
SPIRVLegalizePointerCast.cpp
Go to the documentation of this file.
1//===-- SPIRVLegalizePointerCast.cpp ----------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// The LLVM IR has multiple legal patterns we cannot lower to Logical SPIR-V.
10// This pass modifies such loads to have an IR we can directly lower to valid
11// logical SPIR-V.
12// OpenCL can avoid this because they rely on ptrcast, which is not supported
13// by logical SPIR-V.
14//
15// This pass relies on the assign_ptr_type intrinsic to deduce the type of the
16// pointed values, must replace all occurences of `ptrcast`. This is why
17// unhandled cases are reported as unreachable: we MUST cover all cases.
18//
19// 1. Loading the first element of an array
20//
21// %array = [10 x i32]
22// %value = load i32, ptr %array
23//
24// LLVM can skip the GEP instruction, and only request loading the first 4
25// bytes. In logical SPIR-V, we need an OpAccessChain to access the first
26// element. This pass will add a getelementptr instruction before the load.
27//
28//
29// 2. Implicit downcast from load
30//
31// %1 = getelementptr <4 x i32>, ptr %vec4, i64 0
32// %2 = load <3 x i32>, ptr %1
33//
34// The pointer in the GEP instruction is only used for offset computations,
35// but it doesn't NEED to match the pointed type. OpAccessChain however
36// requires this. Also, LLVM loads define the bitwidth of the load, not the
37// pointer. In this example, we can guess %vec4 is a vec4 thanks to the GEP
38// instruction basetype, but we only want to load the first 3 elements, hence
39// do a partial load. In logical SPIR-V, this is not legal. What we must do
40// is load the full vector (basetype), extract 3 elements, and recombine them
41// to form a 3-element vector.
42//
43//===----------------------------------------------------------------------===//
44
45#include "SPIRV.h"
46#include "SPIRVSubtarget.h"
47#include "SPIRVTargetMachine.h"
48#include "SPIRVUtils.h"
49#include "llvm/IR/IRBuilder.h"
51#include "llvm/IR/Intrinsics.h"
52#include "llvm/IR/IntrinsicsSPIRV.h"
55
56using namespace llvm;
57
58namespace {
59class SPIRVLegalizePointerCast : public FunctionPass {
60
61 // Builds the `spv_assign_type` assigning |Ty| to |Value| at the current
62 // builder position.
63 void buildAssignType(IRBuilder<> &B, Type *Ty, Value *Arg) {
64 Value *OfType = PoisonValue::get(Ty);
65 CallInst *AssignCI = buildIntrWithMD(Intrinsic::spv_assign_type,
66 {Arg->getType()}, OfType, Arg, {}, B);
67 GR->addAssignPtrTypeInstr(Arg, AssignCI);
68 }
69
70 // Loads parts of the vector of type |SourceType| from the pointer |Source|
71 // and create a new vector of type |TargetType|. |TargetType| must be a vector
72 // type, and element types of |TargetType| and |SourceType| must match.
73 // Returns the loaded value.
74 Value *loadVectorFromVector(IRBuilder<> &B, FixedVectorType *SourceType,
75 FixedVectorType *TargetType, Value *Source) {
76 LoadInst *NewLoad = B.CreateLoad(SourceType, Source);
77 buildAssignType(B, SourceType, NewLoad);
78 Value *AssignValue = NewLoad;
79 if (TargetType->getElementType() != SourceType->getElementType()) {
80 const DataLayout &DL = B.GetInsertBlock()->getModule()->getDataLayout();
81 [[maybe_unused]] TypeSize TargetTypeSize =
82 DL.getTypeSizeInBits(TargetType);
83 [[maybe_unused]] TypeSize SourceTypeSize =
84 DL.getTypeSizeInBits(SourceType);
85 assert(TargetTypeSize == SourceTypeSize);
86 AssignValue = B.CreateIntrinsic(Intrinsic::spv_bitcast,
87 {TargetType, SourceType}, {NewLoad});
88 buildAssignType(B, TargetType, AssignValue);
89 return AssignValue;
90 }
91
92 assert(TargetType->getNumElements() < SourceType->getNumElements());
93 SmallVector<int> Mask(/* Size= */ TargetType->getNumElements());
94 for (unsigned I = 0; I < TargetType->getNumElements(); ++I)
95 Mask[I] = I;
96 Value *Output = B.CreateShuffleVector(AssignValue, AssignValue, Mask);
97 buildAssignType(B, TargetType, Output);
98 return Output;
99 }
100
101 // Loads the first value in an aggregate pointed by |Source| of containing
102 // elements of type |ElementType|. Load flags will be copied from |BadLoad|,
103 // which should be the load being legalized. Returns the loaded value.
104 Value *loadFirstValueFromAggregate(IRBuilder<> &B, Type *ElementType,
105 Value *Source, LoadInst *BadLoad) {
107 Source->getType()};
108 SmallVector<Value *, 8> Args{/* isInBounds= */ B.getInt1(false), Source};
109
110 Type *AggregateType = GR->findDeducedElementType(Source);
111 assert(AggregateType && "Could not deduce aggregate type");
112 buildGEPIndexChain(B, ElementType, AggregateType, Args);
113
114 auto *GEP = B.CreateIntrinsic(Intrinsic::spv_gep, {Types}, {Args});
115 GR->buildAssignPtr(B, ElementType, GEP);
116
117 LoadInst *LI = B.CreateLoad(ElementType, GEP);
118 LI->setAlignment(BadLoad->getAlign());
119 buildAssignType(B, ElementType, LI);
120 return LI;
121 }
122
123 // Loads elements from an array and constructs a vector.
124 Value *loadVectorFromArray(IRBuilder<> &B, FixedVectorType *TargetType,
125 Value *Source) {
126 // Load each element of the array.
127 SmallVector<Value *, 4> LoadedElements;
128 for (unsigned i = 0; i < TargetType->getNumElements(); ++i) {
129 // Create a GEP to access the i-th element of the array.
130 SmallVector<Type *, 2> Types = {Source->getType(), Source->getType()};
132 Args.push_back(B.getInt1(false));
133 Args.push_back(Source);
134 Args.push_back(B.getInt32(0));
135 Args.push_back(ConstantInt::get(B.getInt32Ty(), i));
136 auto *ElementPtr = B.CreateIntrinsic(Intrinsic::spv_gep, {Types}, {Args});
137 GR->buildAssignPtr(B, TargetType->getElementType(), ElementPtr);
138
139 // Load the value from the element pointer.
140 Value *Load = B.CreateLoad(TargetType->getElementType(), ElementPtr);
141 buildAssignType(B, TargetType->getElementType(), Load);
142 LoadedElements.push_back(Load);
143 }
144
145 // Build the vector from the loaded elements.
146 Value *NewVector = PoisonValue::get(TargetType);
147 buildAssignType(B, TargetType, NewVector);
148
149 for (unsigned i = 0; i < TargetType->getNumElements(); ++i) {
150 Value *Index = B.getInt32(i);
151 SmallVector<Type *, 4> Types = {TargetType, TargetType,
152 TargetType->getElementType(),
153 Index->getType()};
154 SmallVector<Value *> Args = {NewVector, LoadedElements[i], Index};
155 NewVector = B.CreateIntrinsic(Intrinsic::spv_insertelt, {Types}, {Args});
156 buildAssignType(B, TargetType, NewVector);
157 }
158 return NewVector;
159 }
160
161 // Stores elements from a vector into an array.
162 void storeArrayFromVector(IRBuilder<> &B, Value *SrcVector,
163 Value *DstArrayPtr, ArrayType *ArrTy,
164 Align Alignment) {
165 auto *VecTy = cast<FixedVectorType>(SrcVector->getType());
166
167 // Ensure the element types of the array and vector are the same.
168 assert(VecTy->getElementType() == ArrTy->getElementType() &&
169 "Element types of array and vector must be the same.");
170
171 const DataLayout &DL = B.GetInsertBlock()->getModule()->getDataLayout();
172 uint64_t ElemSize = DL.getTypeAllocSize(ArrTy->getElementType());
173
174 for (unsigned i = 0; i < VecTy->getNumElements(); ++i) {
175 // Create a GEP to access the i-th element of the array.
176 SmallVector<Type *, 2> Types = {DstArrayPtr->getType(),
177 DstArrayPtr->getType()};
179 Args.push_back(B.getInt1(false));
180 Args.push_back(DstArrayPtr);
181 Args.push_back(B.getInt32(0));
182 Args.push_back(ConstantInt::get(B.getInt32Ty(), i));
183 auto *ElementPtr = B.CreateIntrinsic(Intrinsic::spv_gep, {Types}, {Args});
184 GR->buildAssignPtr(B, ArrTy->getElementType(), ElementPtr);
185
186 // Extract the element from the vector and store it.
187 Value *Index = B.getInt32(i);
188 SmallVector<Type *, 3> EltTypes = {VecTy->getElementType(), VecTy,
189 Index->getType()};
190 SmallVector<Value *, 2> EltArgs = {SrcVector, Index};
191 Value *Element =
192 B.CreateIntrinsic(Intrinsic::spv_extractelt, {EltTypes}, {EltArgs});
193 buildAssignType(B, VecTy->getElementType(), Element);
194
195 Types = {Element->getType(), ElementPtr->getType()};
196 Align NewAlign = commonAlignment(Alignment, i * ElemSize);
197 Args = {Element, ElementPtr, B.getInt16(2), B.getInt8(NewAlign.value())};
198 B.CreateIntrinsic(Intrinsic::spv_store, {Types}, {Args});
199 }
200 }
201
202 // Replaces the load instruction to get rid of the ptrcast used as source
203 // operand.
204 void transformLoad(IRBuilder<> &B, LoadInst *LI, Value *CastedOperand,
205 Value *OriginalOperand) {
206 Type *FromTy = GR->findDeducedElementType(OriginalOperand);
207 Type *ToTy = GR->findDeducedElementType(CastedOperand);
208 Value *Output = nullptr;
209
210 auto *SAT = dyn_cast<ArrayType>(FromTy);
211 auto *SVT = dyn_cast<FixedVectorType>(FromTy);
212 auto *DVT = dyn_cast<FixedVectorType>(ToTy);
213
214 B.SetInsertPoint(LI);
215
216 // Destination is the element type of some member of FromTy. For example,
217 // loading the 1st element of an array:
218 // - float a = array[0];
219 if (isTypeFirstElementAggregate(ToTy, FromTy))
220 Output = loadFirstValueFromAggregate(B, ToTy, OriginalOperand, LI);
221 // Destination is a smaller vector than source or different vector type.
222 // - float3 v3 = vector4;
223 // - float4 v2 = int4;
224 else if (SVT && DVT)
225 Output = loadVectorFromVector(B, SVT, DVT, OriginalOperand);
226 else if (SAT && DVT && SAT->getElementType() == DVT->getElementType())
227 Output = loadVectorFromArray(B, DVT, OriginalOperand);
228 else
229 llvm_unreachable("Unimplemented implicit down-cast from load.");
230
231 GR->replaceAllUsesWith(LI, Output, /* DeleteOld= */ true);
232 DeadInstructions.push_back(LI);
233 }
234
235 // Creates an spv_insertelt instruction (equivalent to llvm's insertelement).
236 Value *makeInsertElement(IRBuilder<> &B, Value *Vector, Value *Element,
237 unsigned Index) {
238 Type *Int32Ty = Type::getInt32Ty(B.getContext());
239 SmallVector<Type *, 4> Types = {Vector->getType(), Vector->getType(),
240 Element->getType(), Int32Ty};
241 SmallVector<Value *> Args = {Vector, Element, B.getInt32(Index)};
242 Instruction *NewI =
243 B.CreateIntrinsic(Intrinsic::spv_insertelt, {Types}, {Args});
244 buildAssignType(B, Vector->getType(), NewI);
245 return NewI;
246 }
247
248 // Creates an spv_extractelt instruction (equivalent to llvm's
249 // extractelement).
250 Value *makeExtractElement(IRBuilder<> &B, Type *ElementType, Value *Vector,
251 unsigned Index) {
252 Type *Int32Ty = Type::getInt32Ty(B.getContext());
254 SmallVector<Value *> Args = {Vector, B.getInt32(Index)};
255 Instruction *NewI =
256 B.CreateIntrinsic(Intrinsic::spv_extractelt, {Types}, {Args});
257 buildAssignType(B, ElementType, NewI);
258 return NewI;
259 }
260
261 // Stores the given Src vector operand into the Dst vector, adjusting the size
262 // if required.
263 Value *storeVectorFromVector(IRBuilder<> &B, Value *Src, Value *Dst,
264 Align Alignment) {
265 FixedVectorType *SrcType = cast<FixedVectorType>(Src->getType());
266 FixedVectorType *DstType =
267 cast<FixedVectorType>(GR->findDeducedElementType(Dst));
268 auto dstNumElements = DstType->getNumElements();
269 auto srcNumElements = SrcType->getNumElements();
270
271 // if the element type differs, it is a bitcast.
272 if (DstType->getElementType() != SrcType->getElementType()) {
273 // Support bitcast between vectors of different sizes only if
274 // the total bitwidth is the same.
275 [[maybe_unused]] auto dstBitWidth =
276 DstType->getElementType()->getScalarSizeInBits() * dstNumElements;
277 [[maybe_unused]] auto srcBitWidth =
278 SrcType->getElementType()->getScalarSizeInBits() * srcNumElements;
279 assert(dstBitWidth == srcBitWidth &&
280 "Unsupported bitcast between vectors of different sizes.");
281
282 Src =
283 B.CreateIntrinsic(Intrinsic::spv_bitcast, {DstType, SrcType}, {Src});
284 buildAssignType(B, DstType, Src);
285 SrcType = DstType;
286
287 StoreInst *SI = B.CreateStore(Src, Dst);
288 SI->setAlignment(Alignment);
289 return SI;
290 }
291
292 assert(DstType->getNumElements() >= SrcType->getNumElements());
293 LoadInst *LI = B.CreateLoad(DstType, Dst);
294 LI->setAlignment(Alignment);
295 Value *OldValues = LI;
296 buildAssignType(B, OldValues->getType(), OldValues);
297 Value *NewValues = Src;
298
299 for (unsigned I = 0; I < SrcType->getNumElements(); ++I) {
300 Value *Element =
301 makeExtractElement(B, SrcType->getElementType(), NewValues, I);
302 OldValues = makeInsertElement(B, OldValues, Element, I);
303 }
304
305 StoreInst *SI = B.CreateStore(OldValues, Dst);
306 SI->setAlignment(Alignment);
307 return SI;
308 }
309
310 void buildGEPIndexChain(IRBuilder<> &B, Type *Search, Type *Aggregate,
311 SmallVectorImpl<Value *> &Indices) {
312 Indices.push_back(B.getInt32(0));
313
314 if (Search == Aggregate)
315 return;
316
317 if (auto *ST = dyn_cast<StructType>(Aggregate))
318 buildGEPIndexChain(B, Search, ST->getTypeAtIndex(0u), Indices);
319 else if (auto *AT = dyn_cast<ArrayType>(Aggregate))
320 buildGEPIndexChain(B, Search, AT->getElementType(), Indices);
321 else if (auto *VT = dyn_cast<FixedVectorType>(Aggregate))
322 buildGEPIndexChain(B, Search, VT->getElementType(), Indices);
323 else
324 llvm_unreachable("Bad access chain?");
325 }
326
327 // Stores the given Src value into the first entry of the Dst aggregate.
328 Value *storeToFirstValueAggregate(IRBuilder<> &B, Value *Src, Value *Dst,
329 Type *DstPointeeType, Align Alignment) {
330 SmallVector<Type *, 2> Types = {Dst->getType(), Dst->getType()};
331 SmallVector<Value *, 8> Args{/* isInBounds= */ B.getInt1(true), Dst};
332 buildGEPIndexChain(B, Src->getType(), DstPointeeType, Args);
333 auto *GEP = B.CreateIntrinsic(Intrinsic::spv_gep, {Types}, {Args});
334 GR->buildAssignPtr(B, Src->getType(), GEP);
335 StoreInst *SI = B.CreateStore(Src, GEP);
336 SI->setAlignment(Alignment);
337 return SI;
338 }
339
340 bool isTypeFirstElementAggregate(Type *Search, Type *Aggregate) {
341 if (Search == Aggregate)
342 return true;
343 if (auto *ST = dyn_cast<StructType>(Aggregate))
344 return isTypeFirstElementAggregate(Search, ST->getTypeAtIndex(0u));
345 if (auto *VT = dyn_cast<FixedVectorType>(Aggregate))
346 return isTypeFirstElementAggregate(Search, VT->getElementType());
347 if (auto *AT = dyn_cast<ArrayType>(Aggregate))
348 return isTypeFirstElementAggregate(Search, AT->getElementType());
349 return false;
350 }
351
352 // Transforms a store instruction (or SPV intrinsic) using a ptrcast as
353 // operand into a valid logical SPIR-V store with no ptrcast.
354 void transformStore(IRBuilder<> &B, Instruction *BadStore, Value *Src,
355 Value *Dst, Align Alignment) {
356 Type *ToTy = GR->findDeducedElementType(Dst);
357 Type *FromTy = Src->getType();
358
359 auto *S_VT = dyn_cast<FixedVectorType>(FromTy);
360 auto *D_ST = dyn_cast<StructType>(ToTy);
361 auto *D_VT = dyn_cast<FixedVectorType>(ToTy);
362 auto *D_AT = dyn_cast<ArrayType>(ToTy);
363
364 B.SetInsertPoint(BadStore);
365 if (D_ST && isTypeFirstElementAggregate(FromTy, D_ST))
366 storeToFirstValueAggregate(B, Src, Dst, D_ST, Alignment);
367 else if (D_VT && S_VT)
368 storeVectorFromVector(B, Src, Dst, Alignment);
369 else if (D_VT && !S_VT && FromTy == D_VT->getElementType())
370 storeToFirstValueAggregate(B, Src, Dst, D_VT, Alignment);
371 else if (D_AT && S_VT && S_VT->getElementType() == D_AT->getElementType())
372 storeArrayFromVector(B, Src, Dst, D_AT, Alignment);
373 else
374 llvm_unreachable("Unsupported ptrcast use in store. Please fix.");
375
376 DeadInstructions.push_back(BadStore);
377 }
378
379 void legalizePointerCast(IntrinsicInst *II) {
380 Value *CastedOperand = II;
381 Value *OriginalOperand = II->getOperand(0);
382
383 IRBuilder<> B(II->getContext());
384 std::vector<Value *> Users;
385 for (Use &U : II->uses())
386 Users.push_back(U.getUser());
387
388 for (Value *User : Users) {
389 if (LoadInst *LI = dyn_cast<LoadInst>(User)) {
390 transformLoad(B, LI, CastedOperand, OriginalOperand);
391 continue;
392 }
393
394 if (StoreInst *SI = dyn_cast<StoreInst>(User)) {
395 transformStore(B, SI, SI->getValueOperand(), OriginalOperand,
396 SI->getAlign());
397 continue;
398 }
399
400 if (IntrinsicInst *Intrin = dyn_cast<IntrinsicInst>(User)) {
401 if (Intrin->getIntrinsicID() == Intrinsic::spv_assign_ptr_type) {
402 DeadInstructions.push_back(Intrin);
403 continue;
404 }
405
406 if (Intrin->getIntrinsicID() == Intrinsic::spv_gep) {
407 GR->replaceAllUsesWith(CastedOperand, OriginalOperand,
408 /* DeleteOld= */ false);
409 continue;
410 }
411
412 if (Intrin->getIntrinsicID() == Intrinsic::spv_store) {
413 Align Alignment;
414 if (ConstantInt *C = dyn_cast<ConstantInt>(Intrin->getOperand(3)))
415 Alignment = Align(C->getZExtValue());
416 transformStore(B, Intrin, Intrin->getArgOperand(0), OriginalOperand,
417 Alignment);
418 continue;
419 }
420 }
421
422 llvm_unreachable("Unsupported ptrcast user. Please fix.");
423 }
424
425 DeadInstructions.push_back(II);
426 }
427
428public:
429 SPIRVLegalizePointerCast(SPIRVTargetMachine *TM) : FunctionPass(ID), TM(TM) {}
430
431 bool runOnFunction(Function &F) override {
432 const SPIRVSubtarget &ST = TM->getSubtarget<SPIRVSubtarget>(F);
433 GR = ST.getSPIRVGlobalRegistry();
434 DeadInstructions.clear();
435
436 std::vector<IntrinsicInst *> WorkList;
437 for (auto &BB : F) {
438 for (auto &I : BB) {
439 auto *II = dyn_cast<IntrinsicInst>(&I);
440 if (II && II->getIntrinsicID() == Intrinsic::spv_ptrcast)
441 WorkList.push_back(II);
442 }
443 }
444
445 for (IntrinsicInst *II : WorkList)
446 legalizePointerCast(II);
447
448 for (Instruction *I : DeadInstructions)
449 I->eraseFromParent();
450
451 return DeadInstructions.size() != 0;
452 }
453
454private:
455 SPIRVTargetMachine *TM = nullptr;
456 SPIRVGlobalRegistry *GR = nullptr;
457 std::vector<Instruction *> DeadInstructions;
458
459public:
460 static char ID;
461};
462} // namespace
463
464char SPIRVLegalizePointerCast::ID = 0;
465INITIALIZE_PASS(SPIRVLegalizePointerCast, "spirv-legalize-bitcast",
466 "SPIRV legalize bitcast pass", false, false)
467
469 return new SPIRVLegalizePointerCast(TM);
470}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static bool runOnFunction(Function &F, bool PostInlining)
Hexagon Common GEP
iv Induction Variable Users
Definition IVUsers.cpp:48
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
uint64_t IntrinsicInst * II
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition PassSupport.h:56
unsigned getNumElements() const
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
void setAlignment(Align Align)
Type * getPointerOperandType() const
Align getAlign() const
Return the alignment of the access that is being performed.
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
void push_back(const T &Elt)
LLVM_ABI unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
Definition Type.cpp:230
Type * getType() const
All values are typed, get the type of this value.
Definition Value.h:256
Type * getElementType() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34
ElementType
The element type of an SRV or UAV resource.
Definition DXILABI.h:60
friend class Instruction
Iterator for Instructions in a `BasicBlock.
Definition BasicBlock.h:73
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
FunctionAddr VTableAddr uintptr_t uintptr_t Int32Ty
Definition InstrProf.h:296
CallInst * buildIntrWithMD(Intrinsic::ID IntrID, ArrayRef< Type * > Types, Value *Arg, Value *Arg2, ArrayRef< Constant * > Imms, IRBuilder<> &B)
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
IRBuilder(LLVMContext &, FolderTy, InserterTy, MDNode *, ArrayRef< OperandBundleDef >) -> IRBuilder< FolderTy, InserterTy >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
Align commonAlignment(Align A, uint64_t Offset)
Returns the alignment that satisfies both alignments.
Definition Alignment.h:201
FunctionPass * createSPIRVLegalizePointerCastPass(SPIRVTargetMachine *TM)
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.
Definition Alignment.h:77