33 #define DEBUG_TYPE "indvars" 35 STATISTIC(NumElimIdentity,
"Number of IV identities eliminated");
36 STATISTIC(NumElimOperand,
"Number of IV operands folded into a use");
37 STATISTIC(NumFoldedUser,
"Number of IV users folded into a constant");
38 STATISTIC(NumElimRem ,
"Number of IV remainder operations eliminated");
41 "Number of IV signed division operations converted to unsigned division");
44 "Number of IV signed remainder operations converted to unsigned remainder");
45 STATISTIC(NumElimCmp ,
"Number of IV comparisons eliminated");
52 class SimplifyIndvar {
66 : L(Loop), LI(LI), SE(SE), DT(DT), Rewriter(Rewriter), DeadInsts(Dead),
68 assert(LI &&
"IV simplification requires LoopInfo");
71 bool hasChanged()
const {
return Changed; }
81 bool replaceIVUserWithLoopInvariant(
Instruction *UseInst);
83 bool eliminateOverflowIntrinsic(
CallInst *CI);
86 bool makeIVComparisonInvariant(
ICmpInst *ICmp,
Value *IVOperand);
108 Value *IVSrc =
nullptr;
109 const unsigned OperIdx = 0;
110 const SCEV *FoldedExpr =
nullptr;
111 bool MustDropExactFlag =
false;
115 case Instruction::UDiv:
116 case Instruction::LShr:
119 if (IVOperand != UseInst->
getOperand(OperIdx) ||
125 if (!isa<BinaryOperator>(IVOperand)
126 || !isa<ConstantInt>(IVOperand->
getOperand(1)))
131 assert(SE->isSCEVable(IVSrc->
getType()) &&
"Expect SCEVable IV operand");
134 if (UseInst->
getOpcode() == Instruction::LShr) {
143 FoldedExpr = SE->getUDivExpr(SE->getSCEV(IVSrc), SE->getSCEV(D));
147 SE->getSCEV(IVSrc) != SE->getMulExpr(FoldedExpr, SE->getSCEV(D)))
148 MustDropExactFlag =
true;
151 if (!SE->isSCEVable(UseInst->
getType()))
155 if (SE->getSCEV(UseInst) != FoldedExpr)
158 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated IV operand: " << *IVOperand
159 <<
" -> " << *UseInst <<
'\n');
162 assert(SE->getSCEV(UseInst) == FoldedExpr &&
"bad SCEV with folded oper");
164 if (MustDropExactFlag)
170 DeadInsts.emplace_back(IVOperand);
174 bool SimplifyIndvar::makeIVComparisonInvariant(
ICmpInst *ICmp,
176 unsigned IVOperIdx = 0;
188 const SCEV *S = SE->getSCEVAtScope(ICmp->
getOperand(IVOperIdx), ICmpLoop);
189 const SCEV *
X = SE->getSCEVAtScope(ICmp->
getOperand(1 - IVOperIdx), ICmpLoop);
192 const SCEV *InvariantLHS, *InvariantRHS;
197 if (!SE->isLoopInvariantPredicate(Pred, S, X, L, InvariantPredicate,
198 InvariantLHS, InvariantRHS))
206 CheapExpansions[S] = ICmp->
getOperand(IVOperIdx);
207 CheapExpansions[
X] = ICmp->
getOperand(1 - IVOperIdx);
211 if (
auto *BB = L->getLoopPredecessor()) {
212 const int Idx = PN->getBasicBlockIndex(BB);
214 Value *Incoming = PN->getIncomingValue(Idx);
215 const SCEV *IncomingS = SE->getSCEV(Incoming);
216 CheapExpansions[IncomingS] = Incoming;
219 Value *NewLHS = CheapExpansions[InvariantLHS];
220 Value *NewRHS = CheapExpansions[InvariantRHS];
223 if (
auto *ConstLHS = dyn_cast<SCEVConstant>(InvariantLHS))
224 NewLHS = ConstLHS->getValue();
226 if (
auto *ConstRHS = dyn_cast<SCEVConstant>(InvariantRHS))
227 NewRHS = ConstRHS->getValue();
229 if (!NewLHS || !NewRHS)
235 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified comparison: " << *ICmp <<
'\n');
244 void SimplifyIndvar::eliminateIVComparison(
ICmpInst *ICmp,
Value *IVOperand) {
245 unsigned IVOperIdx = 0;
258 const SCEV *S = SE->getSCEVAtScope(ICmp->
getOperand(IVOperIdx), ICmpLoop);
259 const SCEV *X = SE->getSCEVAtScope(ICmp->
getOperand(1 - IVOperIdx), ICmpLoop);
263 if (SE->isKnownPredicate(Pred, S, X)) {
265 DeadInsts.emplace_back(ICmp);
266 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated comparison: " << *ICmp <<
'\n');
269 DeadInsts.emplace_back(ICmp);
270 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated comparison: " << *ICmp <<
'\n');
271 }
else if (makeIVComparisonInvariant(ICmp, IVOperand)) {
274 SE->isKnownNonNegative(S) && SE->isKnownNonNegative(X)) {
281 LLVM_DEBUG(
dbgs() <<
"INDVARS: Turn to unsigned comparison: " << *ICmp
298 N = SE->getSCEVAtScope(
N, L);
299 D = SE->getSCEVAtScope(D, L);
302 if (SE->isKnownNonNegative(
N) && SE->isKnownNonNegative(D)) {
305 SDiv->
getName() +
".udiv", SDiv);
308 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified sdiv: " << *SDiv <<
'\n');
311 DeadInsts.push_back(SDiv);
322 Rem->
getName() +
".urem", Rem);
324 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified srem: " << *Rem <<
'\n');
327 DeadInsts.emplace_back(Rem);
331 void SimplifyIndvar::replaceRemWithNumerator(
BinaryOperator *Rem) {
333 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified rem: " << *Rem <<
'\n');
336 DeadInsts.emplace_back(Rem);
340 void SimplifyIndvar::replaceRemWithNumeratorOrZero(
BinaryOperator *Rem) {
347 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified rem: " << *Rem <<
'\n');
350 DeadInsts.emplace_back(Rem);
362 bool UsedAsNumerator = IVOperand == NValue;
363 if (!UsedAsNumerator && !IsSigned)
366 const SCEV *
N = SE->getSCEV(NValue);
370 N = SE->getSCEVAtScope(N, ICmpLoop);
372 bool IsNumeratorNonNegative = !IsSigned || SE->isKnownNonNegative(N);
375 if (!IsNumeratorNonNegative)
378 const SCEV *D = SE->getSCEV(DValue);
379 D = SE->getSCEVAtScope(D, ICmpLoop);
381 if (UsedAsNumerator) {
383 if (SE->isKnownPredicate(
LT, N, D)) {
384 replaceRemWithNumerator(Rem);
389 const auto *NLessOne = SE->getMinusSCEV(N, SE->getOne(
T));
390 if (SE->isKnownPredicate(
LT, NLessOne, D)) {
391 replaceRemWithNumeratorOrZero(Rem);
398 if (!IsSigned || !SE->isKnownNonNegative(D))
401 replaceSRemWithURem(Rem);
404 bool SimplifyIndvar::eliminateOverflowIntrinsic(
CallInst *CI) {
421 bool NoSignedOverflow;
423 switch (
F->getIntrinsicID()) {
431 NoSignedOverflow =
true;
438 NoSignedOverflow =
false;
444 RawOp = Instruction::Sub;
445 NoSignedOverflow =
true;
451 RawOp = Instruction::Sub;
452 NoSignedOverflow =
false;
459 auto *NarrowTy = cast<IntegerType>(LHS->
getType());
467 (SE->*
Operation)((SE->*Extension)(LHS, WideTy, 0),
468 (SE->*Extension)(RHS, WideTy, 0), SCEV::FlagAnyWrap, 0);
479 if (NoSignedOverflow)
486 for (
auto *U : CI->
users()) {
487 if (
auto *EVI = dyn_cast<ExtractValueInst>(U)) {
488 if (EVI->getIndices()[0] == 1)
491 assert(EVI->getIndices()[0] == 0 &&
"Only two possibilities!");
492 EVI->replaceAllUsesWith(NewResult);
498 for (
auto *EVI : ToDelete)
499 EVI->eraseFromParent();
507 bool SimplifyIndvar::eliminateTrunc(
TruncInst *TI) {
526 const SCEV *IVSCEV = SE->getSCEV(IV);
527 const SCEV *TISCEV = SE->getSCEV(TI);
531 bool DoesSExtCollapse =
false;
532 bool DoesZExtCollapse =
false;
533 if (IVSCEV == SE->getSignExtendExpr(TISCEV, IVTy))
534 DoesSExtCollapse =
true;
535 if (IVSCEV == SE->getZeroExtendExpr(TISCEV, IVTy))
536 DoesZExtCollapse =
true;
540 if (!DoesSExtCollapse && !DoesZExtCollapse)
546 for (
auto *U : TI->
users()) {
548 if (isa<Instruction>(U) &&
549 !DT->isReachableFromEntry(cast<Instruction>(U)->
getParent()))
551 if (
ICmpInst *ICI = dyn_cast<ICmpInst>(U)) {
552 if (ICI->getOperand(0) == TI && L->
isLoopInvariant(ICI->getOperand(1))) {
555 if (ICI->isSigned() && !DoesSExtCollapse)
557 if (ICI->isUnsigned() && !DoesZExtCollapse)
567 auto CanUseZExt = [&](
ICmpInst *ICI) {
569 if (ICI->isUnsigned())
572 if (!DoesZExtCollapse)
575 if (ICI->isEquality())
581 const SCEV *SCEVOP1 = SE->getSCEV(ICI->getOperand(0));
582 const SCEV *SCEVOP2 = SE->getSCEV(ICI->getOperand(1));
583 return SE->isKnownNonNegative(SCEVOP1) && SE->isKnownNonNegative(SCEVOP2);
586 for (
auto *ICI : ICmpUsers) {
587 auto *Op1 = ICI->getOperand(1);
596 if (CanUseZExt(ICI)) {
597 assert(DoesZExtCollapse &&
"Unprofitable zext?");
598 Ext =
new ZExtInst(Op1, IVTy,
"zext", ICI);
601 assert(DoesSExtCollapse &&
"Unprofitable sext?");
602 Ext =
new SExtInst(Op1, IVTy,
"sext", ICI);
609 ICI->replaceAllUsesWith(NewICI);
610 DeadInsts.emplace_back(ICI);
615 DeadInsts.emplace_back(TI);
622 bool SimplifyIndvar::eliminateIVUser(
Instruction *UseInst,
624 if (
ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) {
625 eliminateIVComparison(ICmp, IVOperand);
629 bool IsSRem = Bin->getOpcode() == Instruction::SRem;
630 if (IsSRem || Bin->getOpcode() == Instruction::URem) {
631 simplifyIVRemainder(Bin, IVOperand, IsSRem);
635 if (Bin->getOpcode() == Instruction::SDiv)
636 return eliminateSDiv(Bin);
639 if (
auto *CI = dyn_cast<CallInst>(UseInst))
640 if (eliminateOverflowIntrinsic(CI))
643 if (
auto *TI = dyn_cast<TruncInst>(UseInst))
644 if (eliminateTrunc(TI))
647 if (eliminateIdentitySCEV(UseInst, IVOperand))
655 return BB->getTerminator();
661 bool SimplifyIndvar::replaceIVUserWithLoopInvariant(
Instruction *
I) {
662 if (!SE->isSCEVable(I->
getType()))
666 const SCEV *S = SE->getSCEV(I);
668 if (!SE->isLoopInvariant(S, L))
672 if (
Rewriter.isHighCostExpansion(S, L, I))
680 <<
" with loop invariant: " << *S <<
'\n');
683 DeadInsts.emplace_back(I);
688 bool SimplifyIndvar::eliminateIdentitySCEV(
Instruction *UseInst,
690 if (!SE->isSCEVable(UseInst->
getType()) ||
692 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand)))
711 if (isa<PHINode>(UseInst))
714 if (!DT || !DT->dominates(IVOperand, UseInst))
717 if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand))
720 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated identity: " << *UseInst <<
'\n');
725 DeadInsts.emplace_back(UseInst);
731 bool SimplifyIndvar::strengthenOverflowingOperation(
BinaryOperator *BO,
748 case Instruction::Sub:
752 case Instruction::Mul:
762 bool Changed =
false;
765 const SCEV *ExtendAfterOp = SE->getZeroExtendExpr(SE->getSCEV(BO), WideTy);
766 const SCEV *OpAfterExtend = (SE->*GetExprForBO)(
767 SE->getZeroExtendExpr(LHS, WideTy), SE->getZeroExtendExpr(RHS, WideTy),
769 if (ExtendAfterOp == OpAfterExtend) {
777 const SCEV *ExtendAfterOp = SE->getSignExtendExpr(SE->getSCEV(BO), WideTy);
778 const SCEV *OpAfterExtend = (SE->*GetExprForBO)(
779 SE->getSignExtendExpr(LHS, WideTy), SE->getSignExtendExpr(RHS, WideTy),
781 if (ExtendAfterOp == OpAfterExtend) {
798 if (BO->
getOpcode() == Instruction::Shl) {
799 bool Changed =
false;
800 ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand));
801 for (
auto *U : BO->
users()) {
824 SmallVectorImpl< std::pair<Instruction*,Instruction*> > &SimpleIVUsers) {
842 if (!Simplified.
insert(UI).second)
845 SimpleIVUsers.push_back(std::make_pair(UI, Def));
883 if (!SE->isSCEVable(CurrIV->
getType()))
897 while (!SimpleIVUsers.
empty()) {
898 std::pair<Instruction*, Instruction*> UseOper =
907 DeadInsts.emplace_back(UseInst);
912 if (UseInst == CurrIV)
continue;
916 if (replaceIVUserWithLoopInvariant(UseInst))
920 for (
unsigned N = 0; IVOperand; ++
N) {
921 assert(N <= Simplified.
size() &&
"runaway iteration");
923 Value *NewOper = foldIVUser(UseInst, IVOperand);
931 if (eliminateIVUser(UseInst, IVOperand)) {
932 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers);
937 if ((isa<OverflowingBinaryOperator>(BO) &&
938 strengthenOverflowingOperation(BO, IVOperand)) ||
939 (isa<ShlOperator>(BO) && strengthenRightShift(BO, IVOperand))) {
942 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers);
952 pushIVUsers(UseInst, L, Simplified, SimpleIVUsers);
968 SIV.simplifyUsers(CurrIV, V);
969 return SIV.hasChanged();
980 bool Changed =
false;
static unsigned getBitWidth(Type *Ty, const DataLayout &DL)
Returns the bitwidth of the given scalar or pointer type.
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
static ConstantInt * getFalse(LLVMContext &Context)
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This class represents lattice values for constants.
BinaryOps getOpcode() const
This class represents zero extension of integer types.
void push_back(const T &Elt)
The main scalar evolution driver.
This class represents a function call, abstracting a target machine's calling convention.
BlockT * getLoopPreheader() const
If there is a preheader for this loop, return it.
BinaryOp_match< LHS, RHS, Instruction::AShr > m_AShr(const LHS &L, const RHS &R)
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr, Instruction *MDFrom=nullptr)
LLVMContext & getContext() const
All values hold a context through their type.
bool makeLoopInvariant(Value *V, bool &Changed, Instruction *InsertPt=nullptr) const
If the given value is an instruction inside of the loop and it can be hoisted, do so to make it trivi...
STATISTIC(NumFunctions, "Total number of functions")
This class represents a sign extension of integer types.
bool hasNoSignedWrap() const
Determine whether the no signed wrap flag is set.
iterator begin()
Instruction iterator methods.
Value * getArgOperand(unsigned i) const
bool match(Val *V, const Pattern &P)
Interface for visiting interesting IV users that are recognized but not simplified by this utility...
This class represents the LLVM 'select' instruction.
Predicate getInversePredicate() const
For example, EQ -> NE, UGT -> ULE, SLT -> SGE, OEQ -> UNE, UGT -> OLE, OLT -> UGE, etc.
const Loop * getLoop() const
LoopT * getLoopFor(const BlockT *BB) const
Return the inner most loop that BB lives in.
This is the base class for all instructions that perform data casts.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void dropPoisonGeneratingFlags()
Drops flags that may cause this instruction to evaluate to poison despite having non-poison inputs...
BlockT * getHeader() const
void setIsExact(bool b=true)
Set or clear the exact flag on this instruction, which must be an operator which supports this flag...
Type * getType() const
All values are typed, get the type of this value.
This node represents a polynomial recurrence on the trip count of the specified loop.
bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, DominatorTree *DT, LoopInfo *LI, SmallVectorImpl< WeakTrackingVH > &Dead)
SimplifyLoopIVs - Simplify users of induction variables within this loop.
const APInt & getValue() const
Return the constant as an APInt value reference.
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
APInt getUnsignedMin() const
Return the smallest unsigned value contained in the ConstantRange.
This class represents a truncation of integer types.
Value * getOperand(unsigned i) const
BinaryOp_match< LHS, RHS, Instruction::LShr > m_LShr(const LHS &L, const RHS &R)
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
apint_match m_APInt(const APInt *&Res)
Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt...
The instances of the Type class are immutable: once they are created, they are never changed...
PowerPC Reduce CR logical Operation
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
const SCEV * getAddExpr(SmallVectorImpl< const SCEV *> &Ops, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Get a canonical add expression, or something simpler if possible.
static APInt getOneBitSet(unsigned numBits, unsigned BitNo)
Return an APInt with exactly one bit set in the result.
specificval_ty m_Specific(const Value *V)
Match if we have a specific specified value.
BinaryOp_match< LHS, RHS, Instruction::Shl > m_Shl(const LHS &L, const RHS &R)
This instruction compares its operands according to the predicate given to the constructor.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
const SCEV * getMinusSCEV(const SCEV *LHS, const SCEV *RHS, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Return LHS-RHS. Minus is represented in SCEV as A+B*-1.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
bool isExact() const
Determine whether the exact flag is set.
const SCEV * getMulExpr(SmallVectorImpl< const SCEV *> &Ops, SCEV::NoWrapFlags Flags=SCEV::FlagAnyWrap, unsigned Depth=0)
Get a canonical multiply expression, or something simpler if possible.
bool isLoopInvariant(const Value *V) const
Return true if the specified value is loop invariant.
static IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
void setHasNoSignedWrap(bool b=true)
Set or clear the nsw flag on this instruction, which must be an operator which supports this flag...
bool contains(const LoopT *L) const
Return true if the specified loop is contained within in this loop.
Iterator for intrusive lists based on ilist_node.
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.
Type * getType() const
Return the LLVM type of this SCEV expression.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static Instruction * GetLoopInvariantInsertPosition(Loop *L, Instruction *Hint)
This class represents a range of values.
LLVM_NODISCARD T pop_back_val()
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
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.
Predicate getSignedPredicate() const
For example, EQ->EQ, SLE->SLE, UGT->SGT, etc.
bool uge(const APInt &RHS) const
Unsigned greater or equal comparison.
static ConstantInt * getTrue(LLVMContext &Context)
void setPredicate(Predicate P)
Set the predicate for this instruction to the specified value.
void setOperand(unsigned i, Value *Val)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
static bool isSimpleIVUser(Instruction *I, const Loop *L, ScalarEvolution *SE)
Return true if this instruction generates a simple SCEV expression in terms of that IV...
Class for arbitrary precision integers.
static BinaryOperator * Create(BinaryOps Op, Value *S1, Value *S2, const Twine &Name=Twine(), Instruction *InsertBefore=nullptr)
Construct a binary instruction, given the opcode and the two operands.
iterator_range< user_iterator > users()
This class uses information about analyze scalars to rewrite expressions in canonical form...
const DataLayout & getDataLayout() const
Return the DataLayout associated with the module this SCEV instance is operating on.
Virtual Register Rewriter
Predicate getPredicate() const
Return the predicate for this instruction.
This class represents an analyzed expression in the program.
LLVM_NODISCARD bool empty() const
virtual void visitCast(CastInst *Cast)=0
Represents a single loop in the control flow graph.
StringRef getName() const
Return a constant reference to the value's name.
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, DominatorTree *DT, LoopInfo *LI, SmallVectorImpl< WeakTrackingVH > &Dead, SCEVExpander &Rewriter, IVVisitor *V=nullptr)
simplifyUsersOfIV - Simplify instructions that use this induction variable by using ScalarEvolution t...
bool hasNoUnsignedWrap() const
Determine whether the no unsigned wrap flag is set.
void setHasNoUnsignedWrap(bool b=true)
Set or clear the nuw flag on this instruction, which must be an operator which supports this flag...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isInstructionTriviallyDead(Instruction *I, const TargetLibraryInfo *TLI=nullptr)
Return true if the result produced by the instruction is not used, and the instruction has no side ef...
LLVM Value Representation.
const SCEV * getSCEV(Value *V)
Return a SCEV expression for the full generality of the specified expression.
bool isSCEVable(Type *Ty) const
Test if values of the given type are analyzable within the SCEV framework.
static const Function * getParent(const Value *V)
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
NoWrapFlags
NoWrapFlags are bitfield indices into SubclassData.
Predicate getUnsignedPredicate() const
For example, EQ->EQ, SLE->ULE, UGT->UGT, etc.
const SCEV * getZeroExtendExpr(const SCEV *Op, Type *Ty, unsigned Depth=0)
const SCEV * getSignExtendExpr(const SCEV *Op, Type *Ty, unsigned Depth=0)
const BasicBlock * getParent() const
static void pushIVUsers(Instruction *Def, Loop *L, SmallPtrSet< Instruction *, 16 > &Simplified, SmallVectorImpl< std::pair< Instruction *, Instruction *> > &SimpleIVUsers)
Add all uses of Def to the current IV's worklist.