46 #define DEBUG_TYPE "loop-utils" 61 "Must start with an empty predecessors list!");
66 bool IsDedicatedExit =
true;
69 if (isa<IndirectBrInst>(PredBB->getTerminator()))
72 if (isa<CallBrInst>(PredBB->getTerminator()))
78 IsDedicatedExit =
false;
81 assert(!InLoopPredecessors.
empty() &&
"Must have *some* loop predecessor!");
88 BB, InLoopPredecessors,
".loopexit", DT, LI, MSSAU, PreserveLCSSA);
92 dbgs() <<
"WARNING: Can't create a dedicated exit block for loop: " 95 LLVM_DEBUG(
dbgs() <<
"LoopSimplify: Creating dedicated exit block " 96 << NewExitBB->getName() <<
"\n");
103 for (
auto *BB : L->
blocks())
110 if (!Visited.
insert(SuccBB).second)
113 Changed |= RewriteExit(SuccBB);
126 for (
auto &Inst : *Block) {
127 auto Users = Inst.users();
129 auto *
Use = cast<Instruction>(U);
217 for (
unsigned i = 1, ie = LoopID->
getNumOperands(); i < ie; ++i) {
224 mdconst::extract_or_null<ConstantInt>(Node->
getOperand(1));
277 mdconst::extract_or_null<ConstantInt>(MD->
getOperand(1).
get()))
278 return IntMD->getZExtValue();
295 ConstantInt *IntMD = mdconst::extract_or_null<ConstantInt>(AttrMD->get());
304 const char *InheritOptionsExceptPrefix,
bool AlwaysNew) {
313 bool InheritAllAttrs = !InheritOptionsExceptPrefix;
314 bool InheritSomeAttrs =
315 InheritOptionsExceptPrefix && InheritOptionsExceptPrefix[0] !=
'\0';
319 bool Changed =
false;
320 if (InheritAllAttrs || InheritSomeAttrs) {
322 MDNode *
Op = cast<MDNode>(Existing.get());
324 auto InheritThisAttribute = [InheritSomeAttrs,
325 InheritOptionsExceptPrefix](
MDNode *
Op) {
326 if (!InheritSomeAttrs)
333 if (!isa<MDString>(NameMD))
335 StringRef AttrName = cast<MDString>(NameMD)->getString();
338 return !AttrName.
startswith(InheritOptionsExceptPrefix);
341 if (InheritThisAttribute(Op))
351 bool HasAnyFollowup =
false;
352 for (
StringRef OptionName : FollowupOptions) {
357 HasAnyFollowup =
true;
366 if (!AlwaysNew && !HasAnyFollowup)
370 if (!AlwaysNew && !Changed)
380 return FollowupLoopID;
444 if (Enable ==
true && VectorizeWidth == 1 && InterleaveCount == 1)
453 if (VectorizeWidth == 1 && InterleaveCount == 1)
456 if (VectorizeWidth > 1 || InterleaveCount > 1)
497 AddRegionToWorklist(N);
499 for (
size_t I = 0;
I < Worklist.
size();
I++)
501 AddRegionToWorklist(Child);
511 assert(Preheader &&
"Preheader should exist!");
526 assert(ExitBlock &&
"Should have a unique exit block!");
530 assert(OldBr &&
"Preheader must end with a branch");
531 assert(OldBr->isUnconditional() &&
"Preheader must have a single successor");
558 Builder.CreateCondBr(Builder.getFalse(), L->
getHeader(), ExitBlock);
560 OldBr->eraseFromParent();
564 for (
PHINode &
P : ExitBlock->phis()) {
569 P.setIncomingBlock(PredIndex, Preheader);
577 for (
unsigned i = 0,
e =
P.getNumIncomingValues() - 1; i !=
e; ++i)
578 P.removeIncomingValue(
e - i,
false);
580 assert((
P.getNumIncomingValues() == 1 &&
581 P.getIncomingBlock(PredIndex) == Preheader) &&
582 "Should have exactly one value and that's from the preheader!");
586 Builder.SetInsertPoint(Preheader->getTerminator());
587 Builder.CreateBr(ExitBlock);
589 Preheader->getTerminator()->eraseFromParent();
611 for (
auto *Block : L->
blocks())
617 if (
auto *Usr = dyn_cast<Instruction>(U.
getUser()))
623 assert(!DT->isReachableFromEntry(U) &&
624 "Unexpected user in reachable block");
630 auto Key = DeadDebugSet.
find({DVI->getVariable(), DVI->getExpression()});
631 if (
Key != DeadDebugSet.
end())
633 DeadDebugSet.
insert({DVI->getVariable(), DVI->getExpression()});
643 Instruction *InsertDbgValueBefore = ExitBlock->getFirstNonPHI();
644 assert(InsertDbgValueBefore &&
645 "There should be a non-PHI instruction in exit block, else these " 646 "instructions will have no parent.");
647 for (
auto *DVI : DeadDebugInst)
649 DVI->getVariable(), DVI->getExpression(),
650 DVI->getDebugLoc(), InsertDbgValueBefore);
654 for (
auto *Block : L->
blocks())
655 Block->dropAllReferences();
664 (*LpI)->eraseFromParent();
693 "At least one edge out of the latch must go to the header");
705 uint64_t TrueVal, FalseVal;
709 if (!TrueVal || !FalseVal)
715 return (TrueVal + (FalseVal / 2)) / FalseVal;
717 return (FalseVal + (TrueVal / 2)) / TrueVal;
728 const SCEV *InnerLoopBECountSC = SE.
getExitCount(InnerLoop, InnerLoopLatch);
729 if (isa<SCEVCouldNotCompute>(InnerLoopBECountSC) ||
779 Cmp = Builder.
CreateFCmp(P, Left, Right,
"rdx.minmax.cmp");
781 Cmp = Builder.
CreateICmp(P, Left, Right,
"rdx.minmax.cmp");
798 for (
unsigned ExtractIdx = 0; ExtractIdx != VF; ++ExtractIdx) {
802 if (Op != Instruction::ICmp && Op != Instruction::FCmp) {
828 "Reduction emission only supported for pow2 vectors!");
831 for (
unsigned i = VF; i != 1; i >>= 1) {
833 for (
unsigned j = 0; j != i / 2; ++j)
834 ShuffleMask[j] = Builder.
getInt32(i / 2 + j);
837 std::fill(&ShuffleMask[i / 2], ShuffleMask.
end(),
844 if (Op != Instruction::ICmp && Op != Instruction::FCmp) {
866 assert(isa<VectorType>(Src->
getType()) &&
"Type must be a vector");
868 std::function<Value *()> BuildFunc;
870 RD::MinMaxRecurrenceKind MinMaxKind = RD::MRK_Invalid;
876 case Instruction::Mul:
879 case Instruction::And:
882 case Instruction::Or:
885 case Instruction::Xor:
888 case Instruction::FAdd:
895 case Instruction::FMul:
902 case Instruction::ICmp:
904 MinMaxKind = Flags.
IsSigned ? RD::MRK_SIntMax : RD::MRK_UIntMax;
909 MinMaxKind = Flags.
IsSigned ? RD::MRK_SIntMin : RD::MRK_UIntMin;
915 case Instruction::FCmp:
917 MinMaxKind = RD::MRK_FloatMax;
920 MinMaxKind = RD::MRK_FloatMin;
950 case RD::RK_FloatAdd:
952 case RD::RK_FloatMult:
954 case RD::RK_IntegerAdd:
956 case RD::RK_IntegerMult:
958 case RD::RK_IntegerAnd:
960 case RD::RK_IntegerOr:
962 case RD::RK_IntegerXor:
964 case RD::RK_IntegerMinMax: {
966 Flags.
IsMaxOp = (MMKind == RD::MRK_SIntMax || MMKind == RD::MRK_UIntMax);
967 Flags.
IsSigned = (MMKind == RD::MRK_SIntMax || MMKind == RD::MRK_SIntMin);
970 case RD::RK_FloatMinMax: {
983 auto *Intersection = (OpValue ==
nullptr) ? dyn_cast<Instruction>(VL[0])
987 const unsigned Opcode = Intersection->
getOpcode();
988 VecOp->copyIRFlags(Intersection);
993 if (OpValue ==
nullptr || Opcode == Instr->getOpcode())
Legacy wrapper pass to provide the GlobalsAAResult object.
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
Type * getVectorElementType() const
Tracking metadata reference owned by Metadata.
Value * CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const Twine &Name="")
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
BlockT * getLoopLatch() const
If there is a single latch block for this loop, return it.
Value * CreateBinOp(Instruction::BinaryOps Opc, Value *LHS, Value *RHS, const Twine &Name="", MDNode *FPMathTag=nullptr)
void setFast(bool B=true)
bool hasDisableLICMTransformsHint(const Loop *L)
Look for the loop attribute that disables the LICM transformation heuristics.
const SCEV * getConstant(ConstantInt *V)
This class represents lattice values for constants.
This is the interface for a simple mod/ref and alias analysis over globals.
void replaceOperandWith(unsigned I, Metadata *New)
Replace a specific operand.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
static MDString * get(LLVMContext &Context, StringRef Str)
bool hasDedicatedExits() const
Return true if no exit block for the loop has a predecessor that is outside the loop.
bool isLCSSAForm(DominatorTree &DT) const
Return true if the Loop is in LCSSA form.
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void push_back(const T &Elt)
static void Cleanup(DenseMap< Instruction *, Instruction *> &NewPredicates, SetVector< Instruction *> &MaybeDead, Loop *L)
bool cannotBeMinInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE, bool Signed)
Returns true if S is defined and never is equal to signed/unsigned min.
The main scalar evolution driver.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION
bool isKnownNonNegativeInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE)
Returns true if we can prove that S is defined and always non-negative in loop L. ...
BlockT * getLoopPreheader() const
If there is a preheader for this loop, return it.
bool isAvailableAtLoopEntry(const SCEV *S, const Loop *L)
Determine if the SCEV can be evaluated at loop's entry.
0 1 0 0 True if ordered and less than
Value * createSimpleTargetReduction(IRBuilder<> &B, const TargetTransformInfo *TTI, unsigned Opcode, Value *Src, TargetTransformInfo::ReductionFlags Flags=TargetTransformInfo::ReductionFlags(), ArrayRef< Value *> RedOps=None)
Create a target reduction of the given vector.
LLVM_NODISCARD detail::scope_exit< typename std::decay< Callable >::type > make_scope_exit(Callable &&F)
BasicBlock * getSuccessor(unsigned i) const
bool hasIterationCountInvariantInParent(Loop *L, ScalarEvolution &SE)
Check inner loop (L) backedge count is known to be invariant on all iterations of its outer loop...
MinMaxRecurrenceKind getMinMaxRecurrenceKind()
const MDOperand & getOperand(unsigned I) const
Value * getShuffleReduction(IRBuilder<> &Builder, Value *Src, unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind=RecurrenceDescriptor::MRK_Invalid, ArrayRef< Value *> RedOps=None)
Generates a vector reduction using shufflevectors to reduce the value.
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
iv Induction Variable Users
LLVMContext & getContext() const
Get the context in which this basic block lives.
bool isKnownNegativeInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE)
Returns true if we can prove that S is defined and always negative in loop L.
static APInt getSignedMaxValue(unsigned numBits)
Gets maximum signed value of APInt for a specific bit width.
static Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
static MDNode * createStringMetadata(Loop *TheLoop, StringRef Name, unsigned V)
Create MDNode for input string.
const SCEV * getZero(Type *Ty)
Return a SCEV for the constant 0 of a specific type.
IntegerType * getInt32Ty()
Fetch the type representing a 32-bit integer.
The SCEV is loop-invariant.
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
Legacy analysis pass which computes MemorySSA.
const CallInst * getTerminatingDeoptimizeCall() const
Returns the call instruction calling @llvm.experimental.deoptimize prior to the terminating return in...
This is the interface for a SCEV-based alias analysis.
void initializeLoopPassPass(PassRegistry &)
Manually defined generic "LoopPass" dependency initialization.
static constexpr UpdateKind Delete
unsigned getNumSuccessors() const
CallInst * CreateFAddReduce(Value *Acc, Value *Src)
Create a vector fadd reduction intrinsic of the source vector.
A Use represents the edge between a Value definition and its users.
TransformationMode hasUnrollAndJamTransformation(Loop *L)
bool isIntegerTy() const
True if this is an instance of IntegerType.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Contains a collection of routines for determining if a given instruction is guaranteed to execute if ...
SmallVector< Instruction *, 8 > findDefsUsedOutsideOfLoop(Loop *L)
Returns the instructions that use values defined in the loop.
BlockT * getHeader() const
The transformation should be applied without considering a cost model.
CallInst * CreateFPMinReduce(Value *Src, bool NoNaN=false)
Create a vector float min reduction intrinsic of the source vector.
void deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE, LoopInfo *LI)
This function deletes dead loops.
Value * getOrderedReduction(IRBuilder<> &Builder, Value *Acc, Value *Src, unsigned Op, RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind=RecurrenceDescriptor::MRK_Invalid, ArrayRef< Value *> RedOps=None)
Generates an ordered vector reduction using extracts to reduce the value.
User * getUser() const LLVM_READONLY
Returns the User that contains this Use.
Type * getType() const
All values are typed, get the type of this value.
op_range operands() const
void setLoopID(MDNode *LoopID) const
Set the llvm.loop loop id metadata for this loop.
const T & getValue() const LLVM_LVALUE_FUNCTION
LLVMContext & getContext() const
This is the common base class for debug info intrinsics for variables.
MDNode * findOptionMDForLoop(const Loop *TheLoop, StringRef Name)
Find string metadata for a loop.
void andIRFlags(const Value *V)
Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
AnalysisUsage & addPreservedID(const void *ID)
void addStringMetadataToLoop(Loop *TheLoop, const char *MDString, unsigned V=0)
Set input string into loop metadata by keeping other values intact.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
bool formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI, MemorySSAUpdater *MSSAU, bool PreserveLCSSA)
Ensure that all exit blocks of the loop are dedicated exits.
The transformation must not be applied.
use_iterator_impl< Use > use_iterator
CallInst * CreateXorReduce(Value *Src)
Create a vector int XOR reduction intrinsic of the source vector.
bool isLoopEntryGuardedByCond(const Loop *L, ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS)
Test whether entry to the loop is protected by a conditional between LHS and RHS. ...
StringRef getString() const
Value * CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS, const Twine &Name="", MDNode *FPMathTag=nullptr)
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata *> MDs)
BasicBlock * SplitBlockPredecessors(BasicBlock *BB, ArrayRef< BasicBlock *> Preds, const char *Suffix, DominatorTree *DT=nullptr, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, bool PreserveLCSSA=false)
This method introduces at least one new basic block into the function and moves some of the predecess...
static Optional< bool > getOptionalBoolLoopAttribute(const Loop *TheLoop, StringRef Name)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static constexpr UpdateKind Insert
llvm::Optional< int > getOptionalIntLoopAttribute(Loop *TheLoop, StringRef Name)
Find named metadata for a loop with an integer value.
constexpr bool isPowerOf2_32(uint32_t Value)
Return true if the argument is a power of two > 0.
LLVM Basic Block Representation.
bool isLoopExiting(const BlockT *BB) const
True if terminator in the block can branch to another block that is outside of the current loop...
The instances of the Type class are immutable: once they are created, they are never changed...
This is an important class for using LLVM in a threaded context.
LoopDisposition getLoopDisposition(const SCEV *S, const Loop *L)
Return the "disposition" of the given SCEV with respect to the given loop.
Conditional or Unconditional Branch instruction.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Value * CreateSelect(Value *C, Value *True, Value *False, const Twine &Name="", Instruction *MDFrom=nullptr)
Value * createMinMaxOp(IRBuilder<> &Builder, RecurrenceDescriptor::MinMaxRecurrenceKind RK, Value *Left, Value *Right)
Returns a Min/Max operation corresponding to MinMaxRecurrenceKind.
std::pair< iterator, bool > insert(const ValueT &V)
static const char * LLVMLoopDisableNonforced
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Represent the analysis usage information of a pass.
TransformationMode hasDistributeTransformation(Loop *L)
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly...
TransformationMode hasVectorizeTransformation(Loop *L)
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
Optional< unsigned > getLoopEstimatedTripCount(Loop *L)
Get a loop's estimated trip count based on branch weight metadata.
Value * CreateExtractElement(Value *Vec, Value *Idx, const Twine &Name="")
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
BlockT * getUniqueExitBlock() const
If getUniqueExitBlocks would return exactly one block, return that block.
iterator_range< decltype(adl_begin(std::declval< T >)))> drop_begin(T &&t, int n)
RecurrenceKind getRecurrenceKind()
void getUniqueNonLatchExitBlocks(SmallVectorImpl< BlockT *> &ExitBlocks) const
Return all unique successor blocks of this loop except successors from Latch block are not considered...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void propagateIRFlags(Value *I, ArrayRef< Value *> VL, Value *OpValue=nullptr)
Get the intersection (logical and) of all of the potential IR flags of each scalar operation (VL) tha...
The transformation should not be applied.
The RecurrenceDescriptor is used to identify recurrences variables in a loop.
0 0 1 0 True if ordered and greater than
bool contains(const LoopT *L) const
Return true if the specified loop is contained within in this loop.
The pass can use heuristics to determine whether a transformation should be applied.
CallInst * CreateAddReduce(Value *Src)
Create a vector int add reduction intrinsic of the source vector.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
This is the shared class of boolean and integer constants.
Legacy wrapper pass to provide the SCEVAAResult object.
The transformation was directed by the user, e.g.
Type * getType() const
Return the LLVM type of this SCEV expression.
void applyUpdates(ArrayRef< DominatorTree::UpdateType > Updates)
Submit updates to all available trees.
CallInst * CreateIntMaxReduce(Value *Src, bool IsSigned=false)
Create a vector integer max reduction intrinsic of the source vector.
AnalysisUsage & addRequiredID(const void *ID)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static bool getBooleanLoopAttribute(const Loop *TheLoop, StringRef Name)
Module.h This file contains the declarations for the Module class.
MDNode * findOptionMDForLoopID(MDNode *LoopID, StringRef Name)
Find and return the loop attribute node for the attribute Name in LoopID.
ConstantInt * getInt32(uint32_t C)
Get a constant 32-bit value.
Value * CreateShuffleVector(Value *V1, Value *V2, Value *Mask, const Twine &Name="")
static APInt getMinValue(unsigned numBits)
Gets minimum unsigned value of APInt for a specific bit width.
static Constant * get(Type *Ty, uint64_t V, bool isSigned=false)
If Ty is a vector type, return a Constant with a splat of the given value.
pred_range predecessors(BasicBlock *BB)
static Constant * get(Type *Ty, double V)
This returns a ConstantFP, or a vector containing a splat of a ConstantFP, for the specified value in...
CallInst * CreateFMulReduce(Value *Acc, Value *Src)
Create a vector fmul reduction intrinsic of the source vector.
Value * createTargetReduction(IRBuilder<> &B, const TargetTransformInfo *TTI, RecurrenceDescriptor &Desc, Value *Src, bool NoNaN=false)
Create a generic target reduction using a recurrence descriptor Desc The target is queried to determi...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Implements a dense probed hash-table based set with some number of buckets stored inline...
Optional< MDNode * > makeFollowupLoopID(MDNode *OrigLoopID, ArrayRef< StringRef > FollowupAttrs, const char *InheritOptionsAttrsPrefix="", bool AlwaysNew=false)
Create a new loop identifier for a loop created from a loop transformation.
unsigned getVectorNumElements() const
LoopDisposition
An enum describing the relationship between a SCEV and a loop.
Class for arbitrary precision integers.
static APInt getMaxValue(unsigned numBits)
Gets maximum unsigned value of APInt for specific bit width.
LLVM_NODISCARD bool equals(StringRef RHS) const
equals - Check for string equality, this is more efficient than compare() when the relative ordering ...
LoopT * getParentLoop() const
CallInst * CreateAndReduce(Value *Src)
Create a vector int AND reduction intrinsic of the source vector.
MDNode * getLoopID() const
Return the llvm.loop loop id metadata node for this loop if it is present.
CallInst * CreateOrReduce(Value *Src)
Create a vector int OR reduction intrinsic of the source vector.
CallInst * CreateIntMinReduce(Value *Src, bool IsSigned=false)
Create a vector integer min reduction intrinsic of the source vector.
This class represents an analyzed expression in the program.
static IntegerType * getInt32Ty(LLVMContext &C)
LLVM_NODISCARD bool empty() const
Represents a single loop in the control flow graph.
ArrayRef< BlockT * > getBlocks() const
Get a list of the basic blocks which make up this loop.
iterator find(const_arg_type_t< ValueT > V)
Optional< const MDOperand * > findStringMetadataForLoop(const Loop *TheLoop, StringRef Name)
Find string metadata for loop.
TransformationMode hasUnrollTransformation(Loop *L)
void getLoopAnalysisUsage(AnalysisUsage &AU)
Helper to consistently add the set of standard passes to a loop pass's AnalysisUsage.
CallInst * CreateMulReduce(Value *Src)
Create a vector int mul reduction intrinsic of the source vector.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
TransformationMode
The mode sets how eager a transformation should be applied.
block_iterator block_end() const
FastMathFlags getFastMathFlags()
SmallVector< DomTreeNode *, 16 > collectChildrenInLoop(DomTreeNode *N, const Loop *CurLoop)
Does a BFS from a given node to all of its children inside a given loop.
TransformationMode hasLICMVersioningTransformation(Loop *L)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static APInt getSignedMinValue(unsigned numBits)
Gets minimum signed value of APInt for a specific bit width.
LLVM Value Representation.
static const char * LLVMLoopDisableLICM
succ_range successors(Instruction *I)
void setFastMathFlags(FastMathFlags NewFMF)
Set the fast-math flags to be used with generated fp-math operators.
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
The legacy pass manager's analysis pass to compute loop information.
Convenience struct for specifying and reasoning about fast-math flags.
StringRef - Represent a constant reference to a string, i.e.
This is the interface for LLVM's primary stateless and local alias analysis.
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
const SCEV * getExitCount(const Loop *L, BasicBlock *ExitingBlock)
Return the number of times the backedge executes before the given exit would be taken; if not exactly...
Legacy analysis pass which computes a DominatorTree.
bool cannotBeMaxInLoop(const SCEV *S, const Loop *L, ScalarEvolution &SE, bool Signed)
Returns true if S is defined and never is equal to signed/unsigned max.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object...
int64_t getSExtValue() const
Return the constant as a 64-bit integer value after it has been sign extended as appropriate for the ...
bool hasDisableAllTransformsHint(const Loop *L)
Look for the loop attribute that disables all transformation heuristic.
CallInst * CreateFPMaxReduce(Value *Src, bool NoNaN=false)
Create a vector float max reduction intrinsic of the source vector.
unsigned getNumOperands() const
Return number of MDNode operands.
bool extractProfMetadata(uint64_t &TrueVal, uint64_t &FalseVal) const
Retrieve the raw weight values of a conditional branch or select.
iterator_range< block_iterator > blocks() const
block_iterator block_begin() const
static Constant * get(ArrayRef< Constant *> V)
bool empty() const
empty - Check if the array is empty.
Legacy wrapper pass to provide the BasicAAResult object.