26 "nvptx-force-min-byval-param-align",
cl::Hidden,
27 cl::desc(
"NVPTX Specific: force 4-byte minimal alignment for byval"
28 " params of device functions."),
39 const Align ABITypeAlign = std::min(
Align(128),
DL.getABITypeAlign(ArgTy));
44 if (!
F || !
F->hasLocalLinkage() ||
45 F->hasAddressTaken(
nullptr,
52 return std::max(
Align(16), ABITypeAlign);
62 Align ArgAlign = InitialAlign;
76 ArgAlign = std::max(ArgAlign,
Align(4));
84 if (!ST.hasNoReturn())
88 "Expect either a call instruction or a function");
91 return CallI->doesNotReturn() &&
92 CallI->getFunctionType()->getReturnType()->isVoidTy();
95 return F->doesNotReturn() &&
96 F->getFunctionType()->getReturnType()->isVoidTy() &&
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
Value * getCalledOperand() const
This class represents a function call, abstracting a target machine's calling convention.
A parsed version of the target data layout string in and methods for querying it.
Primary interface to the complete machine description for the target machine.
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
LLVM_ABI const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
bool shouldEmitPTXNoReturn(const Value *V, const TargetMachine &TM)
MaybeAlign getAlign(const CallInst &I, unsigned Index)
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
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...
Align getFunctionByValParamAlign(const Function *F, Type *ArgTy, Align InitialAlign, const DataLayout &DL)
static cl::opt< bool > ForceMinByValParamAlign("nvptx-force-min-byval-param-align", cl::Hidden, cl::desc("NVPTX Specific: force 4-byte minimal alignment for byval" " params of device functions."), cl::init(false))
bool isKernelFunction(const Function &F)
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Function * getMaybeBitcastedCallee(const CallBase *CB)
Align getFunctionArgumentAlignment(const Function *F, Type *Ty, unsigned Idx, const DataLayout &DL)
Align getFunctionParamOptimizedAlign(const Function *F, Type *ArgTy, const DataLayout &DL)
Since function arguments are passed via .param space, we may want to increase their alignment in a wa...
This struct is a compact representation of a valid (non-zero power of two) alignment.