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 unsigned OperIdx = 0;
110 const SCEV *FoldedExpr =
nullptr;
114 case Instruction::UDiv:
115 case Instruction::LShr:
118 if (IVOperand != UseInst->
getOperand(OperIdx) ||
124 if (!isa<BinaryOperator>(IVOperand)
125 || !isa<ConstantInt>(IVOperand->
getOperand(1)))
130 assert(SE->isSCEVable(IVSrc->
getType()) &&
"Expect SCEVable IV operand");
133 if (UseInst->
getOpcode() == Instruction::LShr) {
142 FoldedExpr = SE->getUDivExpr(SE->getSCEV(IVSrc), SE->getSCEV(D));
145 if (!SE->isSCEVable(UseInst->
getType()))
149 if (SE->getSCEV(UseInst) != FoldedExpr)
152 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated IV operand: " << *IVOperand
153 <<
" -> " << *UseInst <<
'\n');
156 assert(SE->getSCEV(UseInst) == FoldedExpr &&
"bad SCEV with folded oper");
161 DeadInsts.emplace_back(IVOperand);
165 bool SimplifyIndvar::makeIVComparisonInvariant(
ICmpInst *ICmp,
167 unsigned IVOperIdx = 0;
179 const SCEV *S = SE->getSCEVAtScope(ICmp->
getOperand(IVOperIdx), ICmpLoop);
180 const SCEV *
X = SE->getSCEVAtScope(ICmp->
getOperand(1 - IVOperIdx), ICmpLoop);
183 const SCEV *InvariantLHS, *InvariantRHS;
188 if (!SE->isLoopInvariantPredicate(Pred, S, X, L, InvariantPredicate,
189 InvariantLHS, InvariantRHS))
197 CheapExpansions[S] = ICmp->
getOperand(IVOperIdx);
198 CheapExpansions[
X] = ICmp->
getOperand(1 - IVOperIdx);
202 if (
auto *BB = L->getLoopPredecessor()) {
203 const int Idx = PN->getBasicBlockIndex(BB);
205 Value *Incoming = PN->getIncomingValue(Idx);
206 const SCEV *IncomingS = SE->getSCEV(Incoming);
207 CheapExpansions[IncomingS] = Incoming;
210 Value *NewLHS = CheapExpansions[InvariantLHS];
211 Value *NewRHS = CheapExpansions[InvariantRHS];
214 if (
auto *ConstLHS = dyn_cast<SCEVConstant>(InvariantLHS))
215 NewLHS = ConstLHS->getValue();
217 if (
auto *ConstRHS = dyn_cast<SCEVConstant>(InvariantRHS))
218 NewRHS = ConstRHS->getValue();
220 if (!NewLHS || !NewRHS)
226 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified comparison: " << *ICmp <<
'\n');
235 void SimplifyIndvar::eliminateIVComparison(
ICmpInst *ICmp,
Value *IVOperand) {
236 unsigned IVOperIdx = 0;
249 const SCEV *S = SE->getSCEVAtScope(ICmp->
getOperand(IVOperIdx), ICmpLoop);
250 const SCEV *X = SE->getSCEVAtScope(ICmp->
getOperand(1 - IVOperIdx), ICmpLoop);
254 if (SE->isKnownPredicate(Pred, S, X)) {
256 DeadInsts.emplace_back(ICmp);
257 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated comparison: " << *ICmp <<
'\n');
260 DeadInsts.emplace_back(ICmp);
261 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated comparison: " << *ICmp <<
'\n');
262 }
else if (makeIVComparisonInvariant(ICmp, IVOperand)) {
265 SE->isKnownNonNegative(S) && SE->isKnownNonNegative(X)) {
272 LLVM_DEBUG(
dbgs() <<
"INDVARS: Turn to unsigned comparison: " << *ICmp
289 N = SE->getSCEVAtScope(
N, L);
290 D = SE->getSCEVAtScope(D, L);
293 if (SE->isKnownNonNegative(
N) && SE->isKnownNonNegative(D)) {
296 SDiv->
getName() +
".udiv", SDiv);
299 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified sdiv: " << *SDiv <<
'\n');
302 DeadInsts.push_back(SDiv);
313 Rem->
getName() +
".urem", Rem);
315 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified srem: " << *Rem <<
'\n');
318 DeadInsts.emplace_back(Rem);
322 void SimplifyIndvar::replaceRemWithNumerator(
BinaryOperator *Rem) {
324 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified rem: " << *Rem <<
'\n');
327 DeadInsts.emplace_back(Rem);
331 void SimplifyIndvar::replaceRemWithNumeratorOrZero(
BinaryOperator *Rem) {
338 LLVM_DEBUG(
dbgs() <<
"INDVARS: Simplified rem: " << *Rem <<
'\n');
341 DeadInsts.emplace_back(Rem);
353 bool UsedAsNumerator = IVOperand == NValue;
354 if (!UsedAsNumerator && !IsSigned)
357 const SCEV *
N = SE->getSCEV(NValue);
361 N = SE->getSCEVAtScope(N, ICmpLoop);
363 bool IsNumeratorNonNegative = !IsSigned || SE->isKnownNonNegative(N);
366 if (!IsNumeratorNonNegative)
369 const SCEV *D = SE->getSCEV(DValue);
370 D = SE->getSCEVAtScope(D, ICmpLoop);
372 if (UsedAsNumerator) {
374 if (SE->isKnownPredicate(
LT, N, D)) {
375 replaceRemWithNumerator(Rem);
380 const auto *NLessOne = SE->getMinusSCEV(N, SE->getOne(
T));
381 if (SE->isKnownPredicate(
LT, NLessOne, D)) {
382 replaceRemWithNumeratorOrZero(Rem);
389 if (!IsSigned || !SE->isKnownNonNegative(D))
392 replaceSRemWithURem(Rem);
395 bool SimplifyIndvar::eliminateOverflowIntrinsic(
CallInst *CI) {
406 ExtensionFunctionTy Extension;
412 bool NoSignedOverflow;
414 switch (
F->getIntrinsicID()) {
418 case Intrinsic::sadd_with_overflow:
422 NoSignedOverflow =
true;
425 case Intrinsic::uadd_with_overflow:
429 NoSignedOverflow =
false;
432 case Intrinsic::ssub_with_overflow:
435 RawOp = Instruction::Sub;
436 NoSignedOverflow =
true;
439 case Intrinsic::usub_with_overflow:
442 RawOp = Instruction::Sub;
443 NoSignedOverflow =
false;
450 auto *NarrowTy = cast<IntegerType>(LHS->
getType());
458 (SE->*
Operation)((SE->*Extension)(LHS, WideTy, 0),
459 (SE->*Extension)(RHS, WideTy, 0), SCEV::FlagAnyWrap, 0);
470 if (NoSignedOverflow)
477 for (
auto *U : CI->
users()) {
478 if (
auto *EVI = dyn_cast<ExtractValueInst>(U)) {
479 if (EVI->getIndices()[0] == 1)
482 assert(EVI->getIndices()[0] == 0 &&
"Only two possibilities!");
483 EVI->replaceAllUsesWith(NewResult);
489 for (
auto *EVI : ToDelete)
490 EVI->eraseFromParent();
498 bool SimplifyIndvar::eliminateTrunc(
TruncInst *TI) {
517 const SCEV *IVSCEV = SE->getSCEV(IV);
518 const SCEV *TISCEV = SE->getSCEV(TI);
522 bool DoesSExtCollapse =
false;
523 bool DoesZExtCollapse =
false;
524 if (IVSCEV == SE->getSignExtendExpr(TISCEV, IVTy))
525 DoesSExtCollapse =
true;
526 if (IVSCEV == SE->getZeroExtendExpr(TISCEV, IVTy))
527 DoesZExtCollapse =
true;
531 if (!DoesSExtCollapse && !DoesZExtCollapse)
537 for (
auto *U : TI->
users()) {
539 if (isa<Instruction>(U) &&
540 !DT->isReachableFromEntry(cast<Instruction>(U)->
getParent()))
542 if (
ICmpInst *ICI = dyn_cast<ICmpInst>(U)) {
543 if (ICI->getOperand(0) == TI && L->
isLoopInvariant(ICI->getOperand(1))) {
546 if (ICI->isSigned() && !DoesSExtCollapse)
548 if (ICI->isUnsigned() && !DoesZExtCollapse)
558 auto CanUseZExt = [&](
ICmpInst *ICI) {
560 if (ICI->isUnsigned())
563 if (!DoesZExtCollapse)
566 if (ICI->isEquality())
572 const SCEV *SCEVOP1 = SE->getSCEV(ICI->getOperand(0));
573 const SCEV *SCEVOP2 = SE->getSCEV(ICI->getOperand(1));
574 return SE->isKnownNonNegative(SCEVOP1) && SE->isKnownNonNegative(SCEVOP2);
577 for (
auto *ICI : ICmpUsers) {
578 auto *Op1 = ICI->getOperand(1);
587 if (CanUseZExt(ICI)) {
588 assert(DoesZExtCollapse &&
"Unprofitable zext?");
589 Ext =
new ZExtInst(Op1, IVTy,
"zext", ICI);
592 assert(DoesSExtCollapse &&
"Unprofitable sext?");
593 Ext =
new SExtInst(Op1, IVTy,
"sext", ICI);
600 ICI->replaceAllUsesWith(NewICI);
601 DeadInsts.emplace_back(ICI);
606 DeadInsts.emplace_back(TI);
613 bool SimplifyIndvar::eliminateIVUser(
Instruction *UseInst,
615 if (
ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) {
616 eliminateIVComparison(ICmp, IVOperand);
620 bool IsSRem = Bin->getOpcode() == Instruction::SRem;
621 if (IsSRem || Bin->getOpcode() == Instruction::URem) {
622 simplifyIVRemainder(Bin, IVOperand, IsSRem);
626 if (Bin->getOpcode() == Instruction::SDiv)
627 return eliminateSDiv(Bin);
630 if (
auto *CI = dyn_cast<CallInst>(UseInst))
631 if (eliminateOverflowIntrinsic(CI))
634 if (
auto *TI = dyn_cast<TruncInst>(UseInst))
635 if (eliminateTrunc(TI))
638 if (eliminateIdentitySCEV(UseInst, IVOperand))
646 return BB->getTerminator();
652 bool SimplifyIndvar::replaceIVUserWithLoopInvariant(
Instruction *
I) {
653 if (!SE->isSCEVable(I->
getType()))
657 const SCEV *S = SE->getSCEV(I);
659 if (!SE->isLoopInvariant(S, L))
663 if (
Rewriter.isHighCostExpansion(S, L, I))
671 <<
" with loop invariant: " << *S <<
'\n');
674 DeadInsts.emplace_back(I);
679 bool SimplifyIndvar::eliminateIdentitySCEV(
Instruction *UseInst,
681 if (!SE->isSCEVable(UseInst->
getType()) ||
683 (SE->getSCEV(UseInst) != SE->getSCEV(IVOperand)))
702 if (isa<PHINode>(UseInst))
705 if (!DT || !DT->dominates(IVOperand, UseInst))
708 if (!LI->replacementPreservesLCSSAForm(UseInst, IVOperand))
711 LLVM_DEBUG(
dbgs() <<
"INDVARS: Eliminated identity: " << *UseInst <<
'\n');
716 DeadInsts.emplace_back(UseInst);
722 bool SimplifyIndvar::strengthenOverflowingOperation(
BinaryOperator *BO,
739 case Instruction::Sub:
743 case Instruction::Mul:
753 bool Changed =
false;
756 const SCEV *ExtendAfterOp = SE->getZeroExtendExpr(SE->getSCEV(BO), WideTy);
757 const SCEV *OpAfterExtend = (SE->*GetExprForBO)(
758 SE->getZeroExtendExpr(LHS, WideTy), SE->getZeroExtendExpr(RHS, WideTy),
760 if (ExtendAfterOp == OpAfterExtend) {
768 const SCEV *ExtendAfterOp = SE->getSignExtendExpr(SE->getSCEV(BO), WideTy);
769 const SCEV *OpAfterExtend = (SE->*GetExprForBO)(
770 SE->getSignExtendExpr(LHS, WideTy), SE->getSignExtendExpr(RHS, WideTy),
772 if (ExtendAfterOp == OpAfterExtend) {
789 if (BO->
getOpcode() == Instruction::Shl) {
790 bool Changed =
false;
791 ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand));
792 for (
auto *U : BO->
users()) {
815 SmallVectorImpl< std::pair<Instruction*,Instruction*> > &SimpleIVUsers) {
833 if (!Simplified.
insert(UI).second)
836 SimpleIVUsers.push_back(std::make_pair(UI, Def));
874 if (!SE->isSCEVable(CurrIV->
getType()))
888 while (!SimpleIVUsers.
empty()) {
889 std::pair<Instruction*, Instruction*> UseOper =
898 DeadInsts.emplace_back(UseInst);
903 if (UseInst == CurrIV)
continue;
907 if (replaceIVUserWithLoopInvariant(UseInst))
911 for (
unsigned N = 0; IVOperand; ++
N) {
912 assert(N <= Simplified.
size() &&
"runaway iteration");
914 Value *NewOper = foldIVUser(UseInst, IVOperand);
922 if (eliminateIVUser(UseInst, IVOperand)) {
923 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers);
928 if ((isa<OverflowingBinaryOperator>(BO) &&
929 strengthenOverflowingOperation(BO, IVOperand)) ||
930 (isa<ShlOperator>(BO) && strengthenRightShift(BO, IVOperand))) {
933 pushIVUsers(IVOperand, L, Simplified, SimpleIVUsers);
943 pushIVUsers(UseInst, L, Simplified, SimpleIVUsers);
959 SIV.simplifyUsers(CurrIV, V);
960 return SIV.hasChanged();
971 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.
void push_back(const T &Elt)
static ConstantInt * getFalse(LLVMContext &Context)
Function * getCalledFunction() const
Return the function called, or null if this is an indirect function invocation.
class_match< Value > m_Value()
Match an arbitrary value and ignore it.
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
Compute iterated dominance frontiers using a linear time algorithm.
BinaryOps getOpcode() const
This class represents zero extension of integer types.
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.
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...
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.
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())
Value * getArgOperand(unsigned i) const
getArgOperand/setArgOperand - Return/set the i-th call argument.
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.