32 auto ElementBitWidth = TotalWidth / NumElts;
34 ElementBitWidth <= 128 && TotalWidth <= 256 &&
35 "Invalid width for load");
36 return ElementBitWidth;
42 return std::min(
Align(128),
DL.getABITypeAlign(ArgTy));
57 const bool ShouldForceMinAlign =
59 return ShouldForceMinAlign ?
Align(4) :
Align(1);
74 if (CB && AttrIdx >= AttributeList::FirstArgIndex)
75 ParamAlign = std::max(
88 return StackAlign.
value();
91 if (
F && AttrIdx >= AttributeList::FirstArgIndex) {
92 unsigned ArgNo = AttrIdx - AttributeList::FirstArgIndex;
93 if (
F->getAttributes().hasParamAttr(ArgNo, Attribute::ByVal))
94 return std::max(TypeAlign,
F->getParamAlign(ArgNo).valueOrOne());
103 return StackAlign.
value();
107 if (!DirectCallee && CB)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
This file contains the simple types necessary to represent the attributes associated with functions a...
static Align getByValParamAlignFloor(const Function *F, const LLVMContext &Ctx)
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation or the function signa...
MaybeAlign getParamAlign(unsigned ArgNo) const
Extract the alignment for a call or parameter (0=unknown).
Value * getCalledOperand() const
A parsed version of the target data layout string in and methods for querying it.
This is an important class for using LLVM in a threaded context.
This is an abstract virtual class for memory operations.
EVT getMemoryVT() const
Return the type of the in-memory value.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
LLVM_ABI const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
This is an optimization pass for GlobalISel generic memory operations.
Align getDeviceByValParamAlign(const Function *F, Type *ArgTy, unsigned AttrIdx, const DataLayout &DL)
The .param-space alignment for a byval parameter or call argument: the (possibly promoted) parameter ...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Align getPTXParamTypeAlign(Type *ArgTy, const DataLayout &DL)
ABI alignment of ArgTy in .param space, capped at the PTX maximum of 128.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
Align getPTXParamAlign(const Function *F, Type *Ty, unsigned AttrIdx, const DataLayout &DL)
Alignment for a function parameter or return value at AttributeList index AttrIdx (FirstArgIndex + ar...
const NVPTXOptions & getNVPTXOptions(const LLVMContext &C)
bool isKernelFunction(const Function &F)
Function * getMaybeBitcastedCallee(const CallBase *CB)
MaybeAlign getStackAlign(const Function &F, unsigned Index)
unsigned getFromTypeWidthForLoad(const MemSDNode *Mem)
The bit-width of a single element loaded by Mem, i.e.
This struct is a compact representation of a valid (non-zero power of two) alignment.
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
This struct is a compact representation of a valid (power of two) or undefined (0) alignment.
Align valueOrOne() const
For convenience, returns a valid alignment or 1 if undefined.