52#define DEBUG_TYPE "pre-isel-intrinsic-lowering"
56struct PreISelIntrinsicLowering {
57 const CodeGenOptions &Opts;
67 const bool UseMemIntrinsicLibFunc;
69 explicit PreISelIntrinsicLowering(
75 bool UseMemIntrinsicLibFunc_ =
true)
76 : Opts(Opts_), TM(TM_), ModuleLibcalls(ModuleLibcalls_),
77 LookupTTI(LookupTTI_), LookupTLI(LookupTLI_), LookupAC(LookupAC_),
78 UseMemIntrinsicLibFunc(UseMemIntrinsicLibFunc_) {}
80 bool shouldExpandMemIntrinsicWithSize(
Value *
Size,
82 bool tryExpandBoundedMemSet(
MemSetInst *Memset,
87 bool lowerIntrinsics(
Module &M)
const;
98 Use *LastUse =
nullptr;
100 while (!Intrin.
use_empty() && (!LastUse || LastUse->getNext())) {
101 Use *U = LastUse ? LastUse->getNext() : &*Intrin.
use_begin();
102 bool Removed =
false;
106 Changed |= Removed = Callback(CI);
122 if (!CI || CI->getCalledOperand() != &
F)
126 Value *Ptr = CI->getArgOperand(0);
127 Value *OffsetPtr =
B.CreatePtrAddWithSExtOrTrunc(Ptr, CI->getArgOperand(1));
128 Value *OffsetI32 =
B.CreateAlignedLoad(Int32Ty, OffsetPtr,
Align(4));
130 Value *ResultPtr =
B.CreatePtrAddWithSExtOrTrunc(Ptr, OffsetI32);
132 CI->replaceAllUsesWith(ResultPtr);
133 CI->eraseFromParent();
154 Result = Builder.getFalse();
176 "Pre-ISel intrinsics do lower into regular function calls");
188 M->getOrInsertFunction(NewFnName,
F.getFunctionType());
191 Fn->setLinkage(
F.getLinkage());
195 Fn->addFnAttr(Attribute::NonLazyBind);
204 if (CB->getCalledFunction() != &
F) {
206 "use expected to be the argument of operand bundle "
207 "\"clang.arc.attachedcall\"");
213 assert(CI->getCalledFunction() &&
"Cannot lower an indirect call!");
218 CI->getOperandBundlesAsDefs(BundleList);
219 CallInst *NewCI = Builder.CreateCall(FCache, Args, BundleList);
237 if (
F.getAttributes().hasAttrSomewhere(Attribute::Returned, &Index) &&
239 NewCI->
addParamAttr(Index - AttributeList::FirstArgIndex,
240 Attribute::Returned);
242 if (!CI->use_empty())
243 CI->replaceAllUsesWith(NewCI);
244 CI->eraseFromParent();
252bool PreISelIntrinsicLowering::shouldExpandMemIntrinsicWithSize(
257 uint64_t Threshold = Opts.mem_intrinsic_expand_size.value_or(
263 return SizeVal > Threshold || Threshold == 0;
272 return Lowering.getLibcallImpl(LC) != RTLIB::Unsupported;
280 return Lowering.getMemcpyImpl() != RTLIB::Unsupported;
285bool PreISelIntrinsicLowering::tryExpandBoundedMemSet(
286 MemSetInst *Memset,
const TargetTransformInfo &
TTI)
const {
296 uint64_t Threshold = Opts.bounded_memset_inline_size.value_or(
304 SQ.AC = &LookupAC(*
F);
312 if (RangeAttr.isValid())
337 Type *VTy =
V->getType();
340 if (!RTLCI.
isAvailable(RTLIB::impl_memset_pattern16))
356 if (
DL.isBigEndian())
379bool PreISelIntrinsicLowering::expandMemIntrinsicUses(
380 Function &
F, DenseMap<Constant *, GlobalVariable *> &CMap)
const {
388 case Intrinsic::memcpy: {
390 Function *ParentFunc = Memcpy->getFunction();
391 const TargetTransformInfo &
TTI = LookupTTI(*ParentFunc);
392 if (shouldExpandMemIntrinsicWithSize(Memcpy->getLength(),
TTI)) {
393 if (UseMemIntrinsicLibFunc &&
400 Memcpy->eraseFromParent();
405 case Intrinsic::memcpy_inline: {
414 const TargetTransformInfo &
TTI = LookupTTI(*ParentFunc);
417 Memcpy->eraseFromParent();
420 case Intrinsic::memmove: {
423 const TargetTransformInfo &
TTI = LookupTTI(*ParentFunc);
424 if (shouldExpandMemIntrinsicWithSize(Memmove->getLength(),
TTI)) {
425 if (UseMemIntrinsicLibFunc &&
431 Memmove->eraseFromParent();
437 case Intrinsic::memset: {
440 const TargetTransformInfo &
TTI = LookupTTI(*ParentFunc);
441 if (tryExpandBoundedMemSet(Memset,
TTI)) {
446 if (shouldExpandMemIntrinsicWithSize(Memset->
getLength(),
TTI)) {
447 if (UseMemIntrinsicLibFunc &&
458 case Intrinsic::memset_inline: {
467 const TargetTransformInfo &
TTI = LookupTTI(*ParentFunc);
473 case Intrinsic::experimental_memset_pattern: {
476 const RTLIB::RuntimeLibcallsInfo &RTLCI =
482 const TargetTransformInfo &
TTI = LookupTTI(*ParentFunc);
502 "Should have skipped if non-zero AS");
504 auto It = CMap.
find(PatternValue);
505 if (It != CMap.
end()) {
508 GV =
new GlobalVariable(
509 *M, PatternValue->
getType(),
true,
512 GlobalValue::UnnamedAddr::Global);
515 CMap[PatternValue] = GV;
517 Value *PatternPtr = GV;
518 Value *NumBytes = Builder.CreateMul(
519 ConstantInt::get(SizeTTy,
521 Builder.CreateZExtOrTrunc(Memset->
getLength(), SizeTTy));
522 CallInst *MemsetPattern16Call =
523 Builder.CreateCall(MSP, {Memset->
getRawDest(), PatternPtr, NumBytes});
563 Intr.
getIntrinsicID() == Intrinsic::ptrauth_auth ?
"__emupac_autda"
571 !
Key ||
Key->getZExtValue() != 2)
575 Attribute FSAttr =
F->getFnAttribute(
"target-features");
579 std::vector<OperandBundleDef> DSBundle;
584 auto *EmuCall =
B.CreateCall(
585 EmuIntr, {
Call->getArgOperand(0),
Call->getArgOperand(2)}, DSBundle);
586 Call->replaceAllUsesWith(EmuCall);
587 Call->eraseFromParent();
604 auto *Pointer =
Call->getArgOperand(0);
618 if (
Op->isNullValue()) {
624 if (
Op->isNullValue()) {
639 DSsToDeactivate.
insert(DS);
642 Call->eraseFromParent();
645 if (!DSsToDeactivate.
empty()) {
656 OldDS->replaceAllUsesWith(DS);
657 OldDS->eraseFromParent();
671 Br->setSuccessor(Br->getParent());
672 Call->eraseFromParent();
680 if (!
Call->getParent()->isEntryBlock() &&
682 [](
Instruction &
I) { return !I.mayHaveSideEffects(); })) {
697 if (BI->getSuccessor(0) ==
Call->getParent()) {
699 Cond = BI->getCondition();
704 Cond =
B.CreateNot(BI->getCondition());
707 B.CreateIntrinsic(Intrinsic::cond_loop,
Cond);
711 B.CreateIntrinsic(Intrinsic::cond_loop,
713 Call->eraseFromParent();
718bool PreISelIntrinsicLowering::lowerIntrinsics(
Module &M)
const {
720 DenseMap<Constant *, GlobalVariable *> CMap;
723 switch (
F.getIntrinsicID()) {
726 case Intrinsic::memcpy:
727 case Intrinsic::memcpy_inline:
728 case Intrinsic::memmove:
729 case Intrinsic::memset:
730 case Intrinsic::memset_inline:
731 case Intrinsic::experimental_memset_pattern:
732 Changed |= expandMemIntrinsicUses(
F, CMap);
734 case Intrinsic::load_relative:
737 case Intrinsic::can_load_speculatively:
740 case Intrinsic::is_constant:
741 case Intrinsic::objectsize:
744 TargetLibraryInfo &
TLI = LookupTLI(*Parent);
750#define BEGIN_REGISTER_VP_INTRINSIC(VPID, MASKPOS, VLENPOS) \
751 case Intrinsic::VPID:
752#include "llvm/IR/VPIntrinsics.def"
755 const TargetTransformInfo &
TTI = LookupTTI(*Parent);
761 Changed |= ED != VPExpansionDetails::IntrinsicUnchanged;
762 bool Removed = ED == VPExpansionDetails::IntrinsicReplaced;
766 case Intrinsic::objc_autorelease:
769 case Intrinsic::objc_autoreleasePoolPop:
772 case Intrinsic::objc_autoreleasePoolPush:
775 case Intrinsic::objc_autoreleaseReturnValue:
778 case Intrinsic::objc_copyWeak:
781 case Intrinsic::objc_destroyWeak:
784 case Intrinsic::objc_initWeak:
787 case Intrinsic::objc_loadWeak:
790 case Intrinsic::objc_loadWeakRetained:
793 case Intrinsic::objc_moveWeak:
796 case Intrinsic::objc_release:
799 case Intrinsic::objc_retain:
802 case Intrinsic::objc_retainAutorelease:
805 case Intrinsic::objc_retainAutoreleaseReturnValue:
809 case Intrinsic::objc_retainAutoreleasedReturnValue:
813 case Intrinsic::objc_claimAutoreleasedReturnValue:
817 case Intrinsic::objc_retainBlock:
820 case Intrinsic::objc_storeStrong:
823 case Intrinsic::objc_storeWeak:
826 case Intrinsic::objc_unsafeClaimAutoreleasedReturnValue:
828 lowerObjCCall(
F, RTLIB::impl_objc_unsafeClaimAutoreleasedReturnValue);
830 case Intrinsic::objc_retainedObject:
833 case Intrinsic::objc_unretainedObject:
836 case Intrinsic::objc_unretainedPointer:
839 case Intrinsic::objc_retain_autorelease:
842 case Intrinsic::objc_sync_enter:
845 case Intrinsic::objc_sync_exit:
848 case Intrinsic::acos:
849 case Intrinsic::asin:
850 case Intrinsic::atan:
852 case Intrinsic::cosh:
854 case Intrinsic::exp2:
855 case Intrinsic::exp10:
857 case Intrinsic::log2:
858 case Intrinsic::log10:
860 case Intrinsic::sinh:
862 case Intrinsic::tanh:
875 case Intrinsic::modf:
876 case Intrinsic::sincos:
877 case Intrinsic::sincospi:
893 LC = RTLIB::getMODF(VT);
896 LC = RTLIB::getSINCOS(VT);
899 LC = RTLIB::getSINCOSPI(VT);
905 const LibcallLoweringInfo &Libcalls =
912 case Intrinsic::ptrauth_sign:
913 case Intrinsic::ptrauth_auth:
916 case Intrinsic::protected_field_ptr:
919 case Intrinsic::cond_loop:
923 case Intrinsic::looptrap:
926 if (
auto *CondLoop =
M.getFunction(
"llvm.cond.loop"))
936class PreISelIntrinsicLoweringLegacyPass :
public ModulePass {
940 PreISelIntrinsicLoweringLegacyPass() : ModulePass(
ID) {}
942 void getAnalysisUsage(AnalysisUsage &AU)
const override {
950 bool runOnModule(
Module &M)
override {
951 const ModuleLibcallLoweringInfo &ModuleLibcalls =
952 getAnalysis<LibcallLoweringInfoWrapper>().getResult(M);
954 auto LookupTTI = [
this](
Function &
F) -> TargetTransformInfo & {
955 return this->getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
F);
957 auto LookupTLI = [
this](
Function &
F) -> TargetLibraryInfo & {
958 return this->getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
F);
960 auto LookupAC = [
this](
Function &
F) -> AssumptionCache & {
961 return this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
F);
964 const auto &TM = getAnalysis<TargetPassConfig>().getTM<TargetMachine>();
966 LookupTTI, LookupTLI, LookupAC);
973char PreISelIntrinsicLoweringLegacyPass::ID;
976 "pre-isel-intrinsic-lowering",
977 "Pre-ISel Intrinsic Lowering",
false,
false)
985 "pre-isel-intrinsic-lowering",
989 return new PreISelIntrinsicLoweringLegacyPass();
1010 LookupTTI, LookupTLI, LookupAC);
const AArch64Subtarget & Subtarget
const TargetLowering & TLI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static bool setNonLazyBind(Function &F)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Module.h This file contains the declarations for the Module class.
This defines the Use class.
The header file for the LowerConstantIntrinsics pass as used by the new pass manager.
Machine Check Debug Module
This file defines ARC utility functions which are used by various parts of the compiler.
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
static bool lowerCanLoadSpeculatively(Function &F, const TargetMachine &TM)
Lower @llvm.can.load.speculatively using target-specific expansion.
static GlobalValue * getDeactivationSymbol(CallInst *Call)
static bool canEmitMemcpy(const ModuleLibcallLoweringInfo &ModuleLowering, const TargetMachine &TM, Function *F)
static bool forEachCall(Function &Intrin, T Callback)
static bool expandLoopTrap(Function &Intr)
static bool expandCondLoop(Function &Intr)
static Constant * getMemSetPattern16Value(MemSetPatternInst *Inst, const RTLIB::RuntimeLibcallsInfo &RTLCI)
pre isel intrinsic Pre ISel Intrinsic Lowering
static bool canEmitLibcall(const ModuleLibcallLoweringInfo &ModuleLowering, const TargetMachine &TM, Function *F, RTLIB::Libcall LC)
static CallInst::TailCallKind getOverridingTailCallKind(const Function &F)
static bool expandPtrauthForEmuPAC(Function &Intr)
static bool expandProtectedFieldPtr(Function &Intr)
static bool lowerObjCCall(Function &F, RTLIB::LibcallImpl NewFn, bool setNonLazyBind=false)
static bool lowerLoadRelative(Function &F)
This file contains the declarations for profiling metadata utility functions.
SmallVector< MachineOperand, 4 > Cond
This file describes how to lower LLVM code to machine code.
Target-Independent Code Generator Pass Configuration Options pass.
const AArch64TargetLowering * getTargetLowering() const override
uint64_t getZExtValue() const
Get zero extended value.
bool ugt(const APInt &RHS) const
Unsigned greater than comparison.
AnalysisUsage & addRequired()
static LLVM_ABI ArrayType * get(Type *ElementType, uint64_t NumElements)
This static method is the primary way to construct an ArrayType.
A function analysis which provides an AssumptionCache.
An immutable pass that tracks lazily created AssumptionCache objects.
A cache of @llvm.assume calls within a function.
Functions, function parameters, and return types can have attributes to indicate how they should be t...
LLVM_ABI StringRef getValueAsString() const
Return the attribute's value as a string.
bool isValid() const
Return true if the attribute is any kind of attribute.
InstListType::iterator iterator
Instruction iterators...
void setCallingConv(CallingConv::ID CC)
Attribute getParamAttr(unsigned ArgNo, Attribute::AttrKind Kind) const
Get the attribute of a given kind from a given arg.
void setAttributes(AttributeList A)
Set the attributes for this call.
Value * getArgOperand(unsigned i) const
AttributeList getAttributes() const
Return the attributes for this call.
void addParamAttr(unsigned ArgNo, Attribute::AttrKind Kind)
Adds the attribute to the indicated argument.
This class represents a function call, abstracting a target machine's calling convention.
void setTailCallKind(TailCallKind TCK)
static LLVM_ABI Constant * get(ArrayType *T, ArrayRef< Constant * > V)
static LLVM_ABI Constant * getIntToPtr(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static LLVM_ABI ConstantInt * getTrue(LLVMContext &Context)
static LLVM_ABI ConstantInt * getFalse(LLVMContext &Context)
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
LLVM_ABI APInt getUnsignedMin() const
Return the smallest unsigned value contained in the ConstantRange.
LLVM_ABI bool isEmptySet() const
Return true if this set contains no members.
LLVM_ABI APInt getUnsignedMax() const
Return the largest unsigned value contained in the ConstantRange.
LLVM_ABI ConstantRange intersectWith(const ConstantRange &CR, PreferredRangeType Type=Smallest) const
Return the range that results from the intersection of this range with another range.
This is an important base class in LLVM.
A parsed version of the target data layout string in and methods for querying it.
iterator find(const_arg_type_t< KeyT > Val)
A handy container for a FunctionType+Callee-pointer pair, which can be passed around as a single enti...
FunctionType * getFunctionType()
Type * getParamType(unsigned i) const
Parameter type accessors.
static LLVM_ABI FunctionType * get(Type *Result, ArrayRef< Type * > Params, bool isVarArg)
This static method is the primary way of constructing a FunctionType.
Intrinsic::ID getIntrinsicID() const LLVM_READONLY
getIntrinsicID - This method returns the ID number of the specified function, or Intrinsic::not_intri...
const Function & getFunction() const
static LLVM_ABI GlobalAlias * create(Type *Ty, unsigned AddressSpace, LinkageTypes Linkage, const Twine &Name, Constant *Aliasee, Module *Parent)
If a parent module is specified, the alias is automatically inserted into the end of the specified mo...
void setUnnamedAddr(UnnamedAddr Val)
Module * getParent()
Get the module that this global value is contained inside of...
@ HiddenVisibility
The GV is hidden.
@ PrivateLinkage
Like Internal, but omit from symbol table.
@ ExternalLinkage
Externally visible function.
void setAlignment(Align Align)
Sets the alignment attribute of the GlobalVariable.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
LLVM_ABI const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
LLVM_ABI void setAAMetadata(const AAMDNodes &N)
Sets the AA metadata on this instruction from the AAMDNodes structure.
LLVM_ABI InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
LLVM_ABI const Function * getFunction() const
Return the function this instruction belongs to.
LLVM_ABI AAMDNodes getAAMetadata() const
Returns the AA metadata for this instruction.
LLVM_ABI const DataLayout & getDataLayout() const
Get the data layout of the module this instruction belongs to.
static LLVM_ABI bool mayLowerToFunctionCall(Intrinsic::ID IID)
Check if the intrinsic might lower into a regular function call in the course of IR transformations.
Tracks which library functions to use for a particular subtarget or function.
RTLIB::LibcallImpl getVectorLibcallImplOrMasked(RTLIB::Libcall Call) const
Return the implementation for Call, or for its masked variant if Call has no implementation.
Value * getLength() const
Value * getRawDest() const
const Use & getLengthUse() const
This class wraps the llvm.memset and llvm.memset.inline intrinsics.
This class wraps the llvm.experimental.memset.pattern intrinsic.
Records a mapping from an opaque lowering context to its LibcallLoweringInfo.
const RTLIB::RuntimeLibcallsInfo & getRuntimeLibcallsInfo() const
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
A Module instance is used to store all the information related to an LLVM module.
static LLVM_ABI PointerType * get(LLVMContext &C, unsigned AddressSpace)
This constructs an opaque pointer to an object in a numbered address space.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses none()
Convenience factory function for the empty preserved set.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
bool contains(StringRef Other) const
Return true if the given string is a substring of *this, and false otherwise.
Analysis pass providing the TargetTransformInfo.
Analysis pass providing the TargetLibraryInfo.
Provides information about what library functions are available for the current target.
bool isOperationExpand(unsigned Op, EVT VT) const
Return true if the specified operation is illegal on this target or unlikely to be made legal with cu...
int IntrinsicIDToISD(Intrinsic::ID ID) const
Get the ISD node that corresponds to the Intrinsic ID.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Primary interface to the complete machine description for the target machine.
CodeGenOptLevel getOptLevel() const
Returns the optimization level: None, Less, Default, or Aggressive.
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
virtual bool canLowerCondLoop() const
Returns whether the backend can lower the llvm.cond.loop intrinsic.
Target-Independent Code Generator Pass Configuration Options.
virtual const TargetLowering * getTargetLowering() const
Triple - Helper class for working with autoconf configuration names.
bool isArm64e() const
Tests whether the target is the Apple "arm64e" AArch64 subarch.
The instances of the Type class are immutable: once they are created, they are never changed.
static LLVM_ABI IntegerType * getInt64Ty(LLVMContext &C)
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
LLVM_ABI unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
static LLVM_ABI IntegerType * getInt8Ty(LLVMContext &C)
A Use represents the edge between a Value definition and its users.
LLVM_ABI unsigned getOperandNo() const
Return the operand # of this use in its User.
void setOperand(unsigned i, Value *Val)
Value * getOperand(unsigned i) const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVM_ABI void setName(const Twine &Name)
Change the name of the value.
LLVM_ABI void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
LLVMContext & getContext() const
All values hold a context through their type.
iterator_range< user_iterator > users()
An efficient, type-erasing, non-owning reference to a callable.
const ParentTy * getParent() 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.
@ DELETED_NODE
DELETED_NODE - This is an illegal value that is used to catch errors.
@ FMODF
FMODF - Decomposes the operand into integral and fractional parts, each having the same type and sign...
@ FSINCOSPI
FSINCOSPI - Compute both the sine and cosine times pi more accurately than FSINCOS(pi*x),...
@ FSINCOS
FSINCOS - Compute both fsin and fcos as a single operation.
LLVM_ABI bool IsNeverTail(ARCInstKind Class)
Test if the given class represents instructions which are never safe to mark with the "tail" keyword.
LLVM_ABI bool IsAlwaysTail(ARCInstKind Class)
Test if the given class represents instructions which are always safe to mark with the "tail" keyword...
ARCInstKind
Equivalence classes of instructions in the ARC Model.
LLVM_ABI ARCInstKind GetFunctionClass(const Function *F)
Determine if F is one of the special known Functions.
std::optional< Function * > getAttachedARCFunction(const CallBase *CB)
This function returns operand bundle clang_arc_attachedcall's argument, which is the address of the A...
friend class Instruction
Iterator for Instructions in a `BasicBlock.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI bool lowerUnaryVectorIntrinsicAsLoop(Module &M, CallInst *CI)
Lower CI as a loop.
@ Known
Known to have no common set bits.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI bool lowerConstantIntrinsics(Function &F, const TargetLibraryInfo &TLI, DominatorTree *DT)
LLVM_ABI bool expandMemMoveAsLoop(MemMoveInst *MemMove, const TargetTransformInfo &TTI)
Expand MemMove as a loop.
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
LLVM_ABI void computeKnownBits(const Value *V, KnownBits &Known, const DataLayout &DL, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true, unsigned Depth=0)
Determine which bits of V are known to be either zero or one and return them in the KnownZero/KnownOn...
InnerAnalysisManagerProxy< FunctionAnalysisManager, Module > FunctionAnalysisManagerModuleProxy
Provide the FunctionAnalysisManager to Module proxy.
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
LLVM_ABI ModulePass * createPreISelIntrinsicLoweringPass()
This pass lowers the @llvm.load.relative and @llvm.objc.
LLVM_ABI const LibcallLoweringInfo & getLibcallLowering(const ModuleLibcallLoweringInfo &ModuleInfo, const TargetSubtargetInfo &Subtarget)
Resolve the LibcallLoweringInfo for Subtarget from the module-level ModuleInfo, applying the subtarge...
IRBuilder(LLVMContext &, FolderTy, InserterTy) -> IRBuilder< FolderTy, InserterTy >
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...
LLVM_ABI MDNode * getExplicitlyUnknownBranchWeightsIfProfiled(Function &F, StringRef PassName)
Returns a metadata node containing unknown branch weights if the function has an entry count,...
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
LLVM_ABI VPExpansionDetails expandVectorPredicationIntrinsic(VPIntrinsic &VPI, const TargetTransformInfo &TTI)
Expand a vector predication intrinsic.
OperandBundleDefT< Value * > OperandBundleDef
LLVM_ABI ConstantRange computeConstantRangeIncludingKnownBits(const WithCache< const Value * > &V, bool ForSigned, const SimplifyQuery &SQ)
Combine constant ranges from computeConstantRange() and computeKnownBits().
DWARFExpression::Operation Op
LLVM_ABI void expandBoundedMemSet(MemSetInst *MemSet, uint64_t MinLen, uint64_t MaxLen, const KnownBits &LenKnown)
Expand MemSet, whose length is known to be in [MinLen, MaxLen] and to have the known bits LenKnown,...
LLVM_ABI void expandMemSetAsLoop(MemSetInst *MemSet, const TargetTransformInfo *TTI=nullptr)
Expand MemSet as a loop.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI void expandMemSetPatternAsLoop(MemSetPatternInst *MemSet, const TargetTransformInfo *TTI=nullptr)
Expand MemSetPattern as a loop.
auto predecessors(const MachineBasicBlock *BB)
LLVM_ABI void expandMemCpyAsLoop(MemCpyInst *MemCpy, const TargetTransformInfo &TTI, ScalarEvolution *SE=nullptr)
Expand MemCpy as a loop. MemCpy is not deleted.
LLVM_ABI Instruction * SplitBlockAndInsertIfThen(Value *Cond, BasicBlock::iterator SplitBefore, bool Unreachable, MDNode *BranchWeights=nullptr, DomTreeUpdater *DTU=nullptr, LoopInfo *LI=nullptr, BasicBlock *ThenBlock=nullptr)
Split the containing block at the specified instruction - everything before SplitBefore stays in the ...
VPExpansionDetails
Represents the details the expansion of a VP intrinsic.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
const CodeGenOptions & getCodeGenOptions(const LLVMContext &C)
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
This struct is a compact representation of a valid (non-zero power of two) alignment.
static LLVM_ABI EVT getEVT(Type *Ty, bool HandleUnknown=false)
Return the value type corresponding to the specified type.
LLVM_ABI PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A simple container for information about the supported runtime calls.
LLVM_ABI FunctionCallee getOrInsertLibcallDecl(Module &M, RTLIB::LibcallImpl LibcallImpl) const
CallingConv::ID getLibcallImplCallingConv(RTLIB::LibcallImpl Call) const
Get the CallingConv that should be used for the specified libcall.
bool isAvailable(RTLIB::LibcallImpl Impl) const
static StringRef getLibcallImplName(RTLIB::LibcallImpl CallImpl)
Get the libcall routine name for the specified libcall implementation.