LLVM 23.0.0git
AMDGPULowerKernelArguments.cpp
Go to the documentation of this file.
1//===-- AMDGPULowerKernelArguments.cpp ------------------------------------------===//
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/// \file This pass replaces accesses to kernel arguments with loads from
10/// offsets from the kernarg base pointer.
11//
12//===----------------------------------------------------------------------===//
13
14#include "AMDGPU.h"
16#include "GCNSubtarget.h"
22#include "llvm/IR/Argument.h"
23#include "llvm/IR/Attributes.h"
24#include "llvm/IR/Dominators.h"
25#include "llvm/IR/IRBuilder.h"
27#include "llvm/IR/Instruction.h"
29#include "llvm/IR/IntrinsicsAMDGPU.h"
30#include "llvm/IR/LLVMContext.h"
31#include "llvm/IR/MDBuilder.h"
33#include <optional>
34#include <string>
35
36#define DEBUG_TYPE "amdgpu-lower-kernel-arguments"
37
38using namespace llvm;
39
40namespace {
41
42class AMDGPULowerKernelArguments : public FunctionPass {
43public:
44 static char ID;
45
46 AMDGPULowerKernelArguments() : FunctionPass(ID) {}
47
48 bool runOnFunction(Function &F) override;
49
50 void getAnalysisUsage(AnalysisUsage &AU) const override {
53 AU.setPreservesAll();
54 }
55};
56
57} // end anonymous namespace
58
59// skip allocas
62 for (BasicBlock::iterator E = BB.end(); InsPt != E; ++InsPt) {
63 AllocaInst *AI = dyn_cast<AllocaInst>(&*InsPt);
64
65 // If this is a dynamic alloca, the value may depend on the loaded kernargs,
66 // so loads will need to be inserted before it.
67 if (!AI || !AI->isStaticAlloca())
68 break;
69 }
70
71 return InsPt;
72}
73
75 DominatorTree &DT) {
76 // Collect noalias arguments.
78
79 for (Argument &Arg : F.args())
80 if (Arg.hasNoAliasAttr() && !Arg.use_empty())
81 NoAliasArgs.push_back(&Arg);
82
83 if (NoAliasArgs.empty())
84 return;
85
86 // Add alias scopes for each noalias argument.
87 MDBuilder MDB(F.getContext());
89 MDNode *NewDomain = MDB.createAnonymousAliasScopeDomain(F.getName());
90
91 for (unsigned I = 0u; I < NoAliasArgs.size(); ++I) {
92 const Argument *Arg = NoAliasArgs[I];
93 MDNode *NewScope = MDB.createAnonymousAliasScope(NewDomain, Arg->getName());
94 NewScopes.insert({Arg, NewScope});
95 }
96
97 // Iterate over all instructions.
98 for (inst_iterator Inst = inst_begin(F), InstEnd = inst_end(F);
99 Inst != InstEnd; ++Inst) {
100 // If instruction accesses memory, collect its pointer arguments.
101 Instruction *I = &(*Inst);
103
104 if (std::optional<MemoryLocation> MO = MemoryLocation::getOrNone(I))
105 PtrArgs.push_back(MO->Ptr);
106 else if (const CallBase *Call = dyn_cast<CallBase>(I)) {
107 if (Call->doesNotAccessMemory())
108 continue;
109
110 for (Value *Arg : Call->args()) {
111 if (!Arg->getType()->isPointerTy())
112 continue;
113
114 PtrArgs.push_back(Arg);
115 }
116 } else {
117 // Not a memory access and not a call — nothing to annotate.
118 continue;
119 }
120
121 // Collect underlying objects of pointer arguments.
125
126 if (!PtrArgs.empty()) {
127 // Trace pointer arguments back to underlying objects and decide which
128 // noalias scopes apply based on provenance and capture analysis.
129 for (const Value *Val : PtrArgs) {
131 getUnderlyingObjects(Val, Objects);
132 ObjSet.insert_range(Objects);
133 }
134
135 bool RequiresNoCaptureBefore = false;
136 bool UsesUnknownObject = false;
137 bool UsesAliasingPtr = false;
138
139 for (const Value *Val : ObjSet) {
140 if (isa<ConstantData>(Val))
141 continue;
142
143 if (const Argument *Arg = dyn_cast<Argument>(Val)) {
144 if (!Arg->hasAttribute(Attribute::NoAlias))
145 UsesAliasingPtr = true;
146 } else
147 UsesAliasingPtr = true;
148
149 if (isEscapeSource(Val))
150 RequiresNoCaptureBefore = true;
151 else if (!isa<Argument>(Val) && isIdentifiedObject(Val))
152 UsesUnknownObject = true;
153 }
154
155 if (UsesUnknownObject)
156 continue;
157
158 // Collect noalias scopes for instruction.
159 for (const Argument *Arg : NoAliasArgs) {
160 if (ObjSet.contains(Arg))
161 continue;
162
163 if (!RequiresNoCaptureBefore ||
165 Arg, false, I, &DT, false, CaptureComponents::Provenance)))
166 NoAliases.push_back(NewScopes[Arg]);
167 }
168
169 // Collect scopes for alias.scope metadata.
170 if (!UsesAliasingPtr)
171 for (const Argument *Arg : NoAliasArgs) {
172 if (ObjSet.count(Arg))
173 Scopes.push_back(NewScopes[Arg]);
174 }
175 } else {
176 // The instruction accesses memory but has no pointer arguments.
177 // Since none of its operands derive from any noalias kernel argument,
178 // it cannot possibly alias them. Mark it as !noalias w.r.t. every
179 // noalias scope so that ScopedNoAliasAA can prove non-aliasing when
180 // other instructions reference those scopes via !alias.scope.
181 for (const Argument *Arg : NoAliasArgs)
182 NoAliases.push_back(NewScopes[Arg]);
183 }
184
185 // Add noalias metadata to instruction.
186 if (!NoAliases.empty()) {
187 MDNode *NewMD =
188 MDNode::concatenate(Inst->getMetadata(LLVMContext::MD_noalias),
189 MDNode::get(F.getContext(), NoAliases));
190 Inst->setMetadata(LLVMContext::MD_noalias, NewMD);
191 }
192
193 // Add alias.scope metadata to instruction.
194 if (!Scopes.empty()) {
195 MDNode *NewMD =
196 MDNode::concatenate(Inst->getMetadata(LLVMContext::MD_alias_scope),
197 MDNode::get(F.getContext(), Scopes));
198 Inst->setMetadata(LLVMContext::MD_alias_scope, NewMD);
199 }
200 }
201}
202
204 DominatorTree &DT) {
205 CallingConv::ID CC = F.getCallingConv();
206 if (CC != CallingConv::AMDGPU_KERNEL || F.arg_empty())
207 return false;
208
209 const GCNSubtarget &ST = TM.getSubtarget<GCNSubtarget>(F);
210 LLVMContext &Ctx = F.getContext();
211 const DataLayout &DL = F.getDataLayout();
212 BasicBlock &EntryBlock = *F.begin();
213 IRBuilder<> Builder(&EntryBlock, getInsertPt(EntryBlock));
214
215 const Align KernArgBaseAlign(16); // FIXME: Increase if necessary
216 const uint64_t BaseOffset = ST.getExplicitKernelArgOffset();
217
218 Align MaxAlign;
219 // FIXME: Alignment is broken with explicit arg offset.;
220 const uint64_t TotalKernArgSize = ST.getKernArgSegmentSize(F, MaxAlign);
221 if (TotalKernArgSize == 0)
222 return false;
223
224 CallInst *KernArgSegment =
225 Builder.CreateIntrinsic(Intrinsic::amdgcn_kernarg_segment_ptr, {},
226 nullptr, F.getName() + ".kernarg.segment");
227 KernArgSegment->addRetAttr(Attribute::NonNull);
228 KernArgSegment->addRetAttr(
229 Attribute::getWithDereferenceableBytes(Ctx, TotalKernArgSize));
230
231 uint64_t ExplicitArgOffset = 0;
232
233 addAliasScopeMetadata(F, F.getParent()->getDataLayout(), DT);
234
235 for (Argument &Arg : F.args()) {
236 const bool IsByRef = Arg.hasByRefAttr();
237 Type *ArgTy = IsByRef ? Arg.getParamByRefType() : Arg.getType();
238 MaybeAlign ParamAlign = IsByRef ? Arg.getParamAlign() : std::nullopt;
239 Align ABITypeAlign = DL.getValueOrABITypeAlignment(ParamAlign, ArgTy);
240
241 uint64_t Size = DL.getTypeSizeInBits(ArgTy);
242 uint64_t AllocSize = DL.getTypeAllocSize(ArgTy);
243
244 uint64_t EltOffset = alignTo(ExplicitArgOffset, ABITypeAlign) + BaseOffset;
245 ExplicitArgOffset = alignTo(ExplicitArgOffset, ABITypeAlign) + AllocSize;
246
247 // Skip inreg arguments which should be preloaded.
248 if (Arg.use_empty() || Arg.hasInRegAttr())
249 continue;
250
251 // If this is byval, the loads are already explicit in the function. We just
252 // need to rewrite the pointer values.
253 if (IsByRef) {
254 Value *ArgOffsetPtr = Builder.CreateConstInBoundsGEP1_64(
255 Builder.getInt8Ty(), KernArgSegment, EltOffset,
256 Arg.getName() + ".byval.kernarg.offset");
257
258 Value *CastOffsetPtr =
259 Builder.CreateAddrSpaceCast(ArgOffsetPtr, Arg.getType());
260 Arg.replaceAllUsesWith(CastOffsetPtr);
261 continue;
262 }
263
264 if (PointerType *PT = dyn_cast<PointerType>(ArgTy)) {
265 // FIXME: Hack. We rely on AssertZext to be able to fold DS addressing
266 // modes on SI to know the high bits are 0 so pointer adds don't wrap. We
267 // can't represent this with range metadata because it's only allowed for
268 // integer types.
269 if ((PT->getAddressSpace() == AMDGPUAS::LOCAL_ADDRESS ||
270 PT->getAddressSpace() == AMDGPUAS::REGION_ADDRESS) &&
271 !ST.hasUsableDSOffset())
272 continue;
273 }
274
275 auto *VT = dyn_cast<FixedVectorType>(ArgTy);
276 bool IsV3 = VT && VT->getNumElements() == 3;
277 bool DoShiftOpt = Size < 32 && !ArgTy->isAggregateType();
278
279 VectorType *V4Ty = nullptr;
280
281 int64_t AlignDownOffset = alignDown(EltOffset, 4);
282 int64_t OffsetDiff = EltOffset - AlignDownOffset;
283 Align AdjustedAlign = commonAlignment(
284 KernArgBaseAlign, DoShiftOpt ? AlignDownOffset : EltOffset);
285
286 Value *ArgPtr;
287 Type *AdjustedArgTy;
288 if (DoShiftOpt) { // FIXME: Handle aggregate types
289 // Since we don't have sub-dword scalar loads, avoid doing an extload by
290 // loading earlier than the argument address, and extracting the relevant
291 // bits.
292 // TODO: Update this for GFX12 which does have scalar sub-dword loads.
293 //
294 // Additionally widen any sub-dword load to i32 even if suitably aligned,
295 // so that CSE between different argument loads works easily.
296 ArgPtr = Builder.CreateConstInBoundsGEP1_64(
297 Builder.getInt8Ty(), KernArgSegment, AlignDownOffset,
298 Arg.getName() + ".kernarg.offset.align.down");
299 AdjustedArgTy = Builder.getInt32Ty();
300 } else {
301 ArgPtr = Builder.CreateConstInBoundsGEP1_64(
302 Builder.getInt8Ty(), KernArgSegment, EltOffset,
303 Arg.getName() + ".kernarg.offset");
304 AdjustedArgTy = ArgTy;
305 }
306
307 if (IsV3 && Size >= 32) {
308 V4Ty = FixedVectorType::get(VT->getElementType(), 4);
309 // Use the hack that clang uses to avoid SelectionDAG ruining v3 loads
310 AdjustedArgTy = V4Ty;
311 }
312
313 LoadInst *Load =
314 Builder.CreateAlignedLoad(AdjustedArgTy, ArgPtr, AdjustedAlign);
315 Load->setMetadata(LLVMContext::MD_invariant_load, MDNode::get(Ctx, {}));
316
317 MDBuilder MDB(Ctx);
318
319 if (Arg.hasAttribute(Attribute::NoUndef))
320 Load->setMetadata(LLVMContext::MD_noundef, MDNode::get(Ctx, {}));
321
322 if (Arg.hasAttribute(Attribute::Range)) {
323 const ConstantRange &Range =
324 Arg.getAttribute(Attribute::Range).getValueAsConstantRange();
325 Load->setMetadata(LLVMContext::MD_range,
326 MDB.createRange(Range.getLower(), Range.getUpper()));
327 }
328
329 if (isa<PointerType>(ArgTy)) {
330 if (Arg.hasNonNullAttr())
331 Load->setMetadata(LLVMContext::MD_nonnull, MDNode::get(Ctx, {}));
332
333 uint64_t DerefBytes = Arg.getDereferenceableBytes();
334 if (DerefBytes != 0) {
335 Load->setMetadata(
336 LLVMContext::MD_dereferenceable,
337 MDNode::get(Ctx,
338 MDB.createConstant(
339 ConstantInt::get(Builder.getInt64Ty(), DerefBytes))));
340 }
341
342 uint64_t DerefOrNullBytes = Arg.getDereferenceableOrNullBytes();
343 if (DerefOrNullBytes != 0) {
344 Load->setMetadata(
345 LLVMContext::MD_dereferenceable_or_null,
346 MDNode::get(Ctx,
347 MDB.createConstant(ConstantInt::get(Builder.getInt64Ty(),
348 DerefOrNullBytes))));
349 }
350
351 if (MaybeAlign ParamAlign = Arg.getParamAlign()) {
352 Load->setMetadata(
353 LLVMContext::MD_align,
354 MDNode::get(Ctx, MDB.createConstant(ConstantInt::get(
355 Builder.getInt64Ty(), ParamAlign->value()))));
356 }
357 }
358
359 if (DoShiftOpt) {
360 Value *ExtractBits = OffsetDiff == 0 ?
361 Load : Builder.CreateLShr(Load, OffsetDiff * 8);
362
363 IntegerType *ArgIntTy = Builder.getIntNTy(Size);
364 Value *Trunc = Builder.CreateTrunc(ExtractBits, ArgIntTy);
365 Value *NewVal = Builder.CreateBitCast(Trunc, ArgTy,
366 Arg.getName() + ".load");
367 Arg.replaceAllUsesWith(NewVal);
368 } else if (IsV3) {
369 Value *Shuf = Builder.CreateShuffleVector(Load, ArrayRef<int>{0, 1, 2},
370 Arg.getName() + ".load");
371 Arg.replaceAllUsesWith(Shuf);
372 } else {
373 Load->setName(Arg.getName() + ".load");
374 Arg.replaceAllUsesWith(Load);
375 }
376 }
377
378 KernArgSegment->addRetAttr(
379 Attribute::getWithAlignment(Ctx, std::max(KernArgBaseAlign, MaxAlign)));
380
381 return true;
382}
383
384bool AMDGPULowerKernelArguments::runOnFunction(Function &F) {
385 auto &TPC = getAnalysis<TargetPassConfig>();
386 const TargetMachine &TM = TPC.getTM<TargetMachine>();
387 DominatorTree &DT = getAnalysis<DominatorTreeWrapperPass>().getDomTree();
388 return lowerKernelArguments(F, TM, DT);
389}
390
391INITIALIZE_PASS_BEGIN(AMDGPULowerKernelArguments, DEBUG_TYPE,
392 "AMDGPU Lower Kernel Arguments", false, false)
393INITIALIZE_PASS_END(AMDGPULowerKernelArguments, DEBUG_TYPE, "AMDGPU Lower Kernel Arguments",
395
396char AMDGPULowerKernelArguments::ID = 0;
397
399 return new AMDGPULowerKernelArguments();
400}
401
405 bool Changed = lowerKernelArguments(F, TM, DT);
406 if (Changed) {
407 // TODO: Preserves a lot more.
410 return PA;
411 }
412
413 return PreservedAnalyses::all();
414}
static void addAliasScopeMetadata(Function &F, const DataLayout &DL, DominatorTree &DT)
static BasicBlock::iterator getInsertPt(BasicBlock &BB)
static bool lowerKernelArguments(Function &F, const TargetMachine &TM, DominatorTree &DT)
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the simple types necessary to represent the attributes associated with functions a...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static cl::opt< bool > NoAliases("csky-no-aliases", cl::desc("Disable the emission of assembler pseudo instructions"), cl::init(false), cl::Hidden)
static bool runOnFunction(Function &F, bool PostInlining)
AMD GCN specific subclass of TargetSubtarget.
#define DEBUG_TYPE
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition PassSupport.h:44
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Definition PassSupport.h:39
This is the interface for a metadata-based scoped no-alias analysis.
Target-Independent Code Generator Pass Configuration Options pass.
PreservedAnalyses run(Function &, FunctionAnalysisManager &)
an instruction to allocate memory on the stack
LLVM_ABI bool isStaticAlloca() const
Return true if this alloca is in the entry block of the function and is a constant size.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesAll()
Set by analyses that do not transform their input at all.
This class represents an incoming formal argument to a Function.
Definition Argument.h:32
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
static LLVM_ABI Attribute getWithDereferenceableBytes(LLVMContext &Context, uint64_t Bytes)
static LLVM_ABI Attribute getWithAlignment(LLVMContext &Context, Align Alignment)
Return a uniquified Attribute object that has the specific alignment set.
LLVM Basic Block Representation.
Definition BasicBlock.h:62
iterator end()
Definition BasicBlock.h:474
LLVM_ABI const_iterator getFirstInsertionPt() const
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
InstListType::iterator iterator
Instruction iterators...
Definition BasicBlock.h:170
Represents analyses that only rely on functions' control flow.
Definition Analysis.h:73
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
void addRetAttr(Attribute::AttrKind Kind)
Adds the attribute to the return value.
This class represents a function call, abstracting a target machine's calling convention.
This class represents a range of values.
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:64
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
Definition DenseMap.h:241
Analysis pass which computes a DominatorTree.
Definition Dominators.h:278
Legacy analysis pass which computes a DominatorTree.
Definition Dominators.h:316
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:159
static LLVM_ABI FixedVectorType * get(Type *ElementType, unsigned NumElts)
Definition Type.cpp:873
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition IRBuilder.h:2811
Class to represent integer types.
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
An instruction for reading from memory.
MDNode * createAnonymousAliasScope(MDNode *Domain, StringRef Name=StringRef())
Return metadata appropriate for an alias scope root node.
Definition MDBuilder.h:195
LLVM_ABI ConstantAsMetadata * createConstant(Constant *C)
Return the given constant as metadata.
Definition MDBuilder.cpp:25
LLVM_ABI MDNode * createRange(const APInt &Lo, const APInt &Hi)
Return metadata describing the range [Lo, Hi).
Definition MDBuilder.cpp:96
MDNode * createAnonymousAliasScopeDomain(StringRef Name=StringRef())
Return metadata appropriate for an alias scope domain node.
Definition MDBuilder.h:188
Metadata node.
Definition Metadata.h:1080
static LLVM_ABI MDNode * concatenate(MDNode *A, MDNode *B)
Methods for metadata merging.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition Metadata.h:1572
static LLVM_ABI std::optional< MemoryLocation > getOrNone(const Instruction *Inst)
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition Analysis.h:118
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
Definition Analysis.h:151
void insert_range(Range &&R)
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Primary interface to the complete machine description for the target machine.
const STC & getSubtarget(const Function &F) const
This method returns a pointer to the specified type of TargetSubtargetInfo.
Target-Independent Code Generator Pass Configuration Options.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
Definition Type.cpp:313
bool isAggregateType() const
Return true if the type is an aggregate type.
Definition Type.h:321
static LLVM_ABI IntegerType * getIntNTy(LLVMContext &C, unsigned N)
Definition Type.cpp:317
LLVM Value Representation.
Definition Value.h:75
Type * getType() const
All values are typed, get the type of this value.
Definition Value.h:255
LLVM_ABI void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Definition Value.cpp:549
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
Definition Value.cpp:318
CallInst * Call
Changed
@ REGION_ADDRESS
Address space for region memory. (GDS)
@ LOCAL_ADDRESS
Address space for local memory.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
@ AMDGPU_KERNEL
Used for AMDGPU code object kernels.
This is an optimization pass for GlobalISel generic memory operations.
InstIterator< SymbolTableList< BasicBlock >, Function::iterator, BasicBlock::iterator, Instruction > inst_iterator
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
constexpr T alignDown(U Value, V Align, W Skew=0)
Returns the largest unsigned integer less than or equal to Value and is Skew mod Align.
Definition MathExtras.h:546
inst_iterator inst_begin(Function *F)
LLVM_ABI bool PointerMayBeCapturedBefore(const Value *V, bool ReturnCaptures, const Instruction *I, const DominatorTree *DT, bool IncludeI=false, unsigned MaxUsesToExplore=0, const LoopInfo *LI=nullptr)
PointerMayBeCapturedBefore - Return true if this pointer value may be captured by the enclosing funct...
FunctionPass * createAMDGPULowerKernelArgumentsPass()
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Definition Alignment.h:144
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
inst_iterator inst_end(Function *F)
LLVM_ABI bool isEscapeSource(const Value *V)
Returns true if the pointer is one which would have been considered an escape by isNotCapturedBefore.
Align commonAlignment(Align A, uint64_t Offset)
Returns the alignment that satisfies both alignments.
Definition Alignment.h:201
bool capturesAnything(CaptureComponents CC)
Definition ModRef.h:379
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
LLVM_ABI void getUnderlyingObjects(const Value *V, SmallVectorImpl< const Value * > &Objects, const LoopInfo *LI=nullptr, unsigned MaxLookup=MaxLookupSearchDepth)
This method is similar to getUnderlyingObject except that it can look through phi and select instruct...
LLVM_ABI bool isIdentifiedObject(const Value *V)
Return true if this pointer refers to a distinct and identifiable object.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Definition Alignment.h:106