Home
last modified time | relevance | path

Searched refs:ICmpInst (Results 1 – 25 of 82) sorted by relevance

1234

/external/llvm/lib/Transforms/Utils/
DCmpInstAnalysis.cpp44 unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) { in getICmpCode()
45 ICmpInst::Predicate Pred = InvertPred ? ICI->getInversePredicate() in getICmpCode()
49 case ICmpInst::ICMP_UGT: return 1; // 001 in getICmpCode()
50 case ICmpInst::ICMP_SGT: return 1; // 001 in getICmpCode()
51 case ICmpInst::ICMP_EQ: return 2; // 010 in getICmpCode()
52 case ICmpInst::ICMP_UGE: return 3; // 011 in getICmpCode()
53 case ICmpInst::ICMP_SGE: return 3; // 011 in getICmpCode()
54 case ICmpInst::ICMP_ULT: return 4; // 100 in getICmpCode()
55 case ICmpInst::ICMP_SLT: return 4; // 100 in getICmpCode()
56 case ICmpInst::ICMP_NE: return 5; // 101 in getICmpCode()
[all …]
DSimplifyIndVar.cpp73 void eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand);
151 void SimplifyIndvar::eliminateIVComparison(ICmpInst *ICmp, Value *IVOperand) { in eliminateIVComparison()
153 ICmpInst::Predicate Pred = ICmp->getPredicate(); in eliminateIVComparison()
158 Pred = ICmpInst::getSwappedPredicate(Pred); in eliminateIVComparison()
174 else if (SE->isKnownPredicate(ICmpInst::getInversePredicate(Pred), S, X)) in eliminateIVComparison()
206 SE->isKnownPredicate(IsSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, in eliminateIVRemainder()
217 ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, in eliminateIVRemainder()
221 ICmpInst *ICmp = new ICmpInst(Rem, ICmpInst::ICMP_EQ, in eliminateIVRemainder()
241 if (ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) { in eliminateIVUser()
DLowerSwitch.cpp271 ICmpInst* Comp = new ICmpInst(ICmpInst::ICMP_SLT, in switchConvert()
305 ICmpInst* Comp = nullptr; in newLeafBlock()
308 Comp = new ICmpInst(*NewLeaf, ICmpInst::ICMP_EQ, Val, in newLeafBlock()
314 Comp = new ICmpInst(*NewLeaf, ICmpInst::ICMP_SLE, Val, Leaf.High, in newLeafBlock()
318 Comp = new ICmpInst(*NewLeaf, ICmpInst::ICMP_ULE, Val, Leaf.High, in newLeafBlock()
327 Comp = new ICmpInst(*NewLeaf, ICmpInst::ICMP_ULE, Add, UpperBound, in newLeafBlock()
/external/llvm/lib/Transforms/InstCombine/
DInstCombineCompares.cpp120 static bool isSignBitCheck(ICmpInst::Predicate pred, ConstantInt *RHS, in isSignBitCheck()
123 case ICmpInst::ICMP_SLT: // True if LHS s< 0 in isSignBitCheck()
126 case ICmpInst::ICMP_SLE: // True if LHS s<= RHS and RHS == -1 in isSignBitCheck()
129 case ICmpInst::ICMP_SGT: // True if LHS s> -1 in isSignBitCheck()
132 case ICmpInst::ICMP_UGT: in isSignBitCheck()
136 case ICmpInst::ICMP_UGE: in isSignBitCheck()
148 static bool isSignTest(ICmpInst::Predicate &pred, const ConstantInt *RHS) { in isSignTest()
149 if (!ICmpInst::isSigned(pred)) in isSignTest()
153 return ICmpInst::isRelational(pred); in isSignTest()
156 if (pred == ICmpInst::ICMP_SLT) { in isSignTest()
[all …]
DInstCombineAndOrXor.cpp73 ICmpInst::Predicate NewPred; in getNewICmpValue()
303 ICmpInst::ICMP_SLE:ICmpInst::ICMP_ULE), Lo, Hi))->getZExtValue() && in InsertRangeTest()
312 ICmpInst::Predicate pred = (isSigned ? in InsertRangeTest()
313 ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT); in InsertRangeTest()
330 ICmpInst::Predicate pred = (isSigned ? in InsertRangeTest()
331 ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT); in InsertRangeTest()
454 ICmpInst::Predicate SCC) in getTypeOfMaskedICmp()
459 bool icmp_eq = (SCC == ICmpInst::ICMP_EQ); in getTypeOfMaskedICmp()
543 static bool decomposeBitTestICmp(const ICmpInst *I, ICmpInst::Predicate &Pred, in decomposeBitTestICmp()
552 case ICmpInst::ICMP_SLT: in decomposeBitTestICmp()
[all …]
DInstCombineSelect.cpp31 ICmpInst *ICI = dyn_cast<ICmpInst>(SI->getCondition()); in MatchSelectPattern()
34 ICmpInst::Predicate Pred = ICI->getPredicate(); in MatchSelectPattern()
47 case ICmpInst::ICMP_UGT: in MatchSelectPattern()
48 case ICmpInst::ICMP_UGE: return SPF_UMAX; in MatchSelectPattern()
49 case ICmpInst::ICMP_SGT: in MatchSelectPattern()
50 case ICmpInst::ICMP_SGE: return SPF_SMAX; in MatchSelectPattern()
51 case ICmpInst::ICMP_ULT: in MatchSelectPattern()
52 case ICmpInst::ICMP_ULE: return SPF_UMIN; in MatchSelectPattern()
53 case ICmpInst::ICMP_SLT: in MatchSelectPattern()
54 case ICmpInst::ICMP_SLE: return SPF_SMIN; in MatchSelectPattern()
[all …]
DInstCombineInternal.h253 Value *simplifyRangeCheck(ICmpInst *Cmp0, ICmpInst *Cmp1, bool Inverted);
254 Value *FoldAndOfICmps(ICmpInst *LHS, ICmpInst *RHS);
257 Value *FoldOrOfICmps(ICmpInst *LHS, ICmpInst *RHS, Instruction *CxtI);
275 Instruction *visitICmpInst(ICmpInst &I);
276 Instruction *visitICmpInstWithCastAndCast(ICmpInst &ICI);
277 Instruction *visitICmpInstWithInstAndIntCst(ICmpInst &ICI, Instruction *LHS,
279 Instruction *FoldICmpDivCst(ICmpInst &ICI, BinaryOperator *DivI,
281 Instruction *FoldICmpShrCst(ICmpInst &ICI, BinaryOperator *DivI,
283 Instruction *FoldICmpCstShrCst(ICmpInst &I, Value *Op, Value *A,
285 Instruction *FoldICmpCstShlCst(ICmpInst &I, Value *Op, Value *A,
[all …]
DInstCombineCasts.cpp467 return new ICmpInst(ICmpInst::ICMP_NE, Src, Zero); in visitTrunc()
508 Instruction *InstCombiner::transformZExtICmp(ICmpInst *ICI, Instruction &CI, in transformZExtICmp()
518 if ((ICI->getPredicate() == ICmpInst::ICMP_SLT && Op1CV == 0) || in transformZExtICmp()
519 (ICI->getPredicate() == ICmpInst::ICMP_SGT &&Op1CV.isAllOnesValue())) { in transformZExtICmp()
529 if (ICI->getPredicate() == ICmpInst::ICMP_SGT) { in transformZExtICmp()
557 bool isNE = ICI->getPredicate() == ICmpInst::ICMP_NE; in transformZExtICmp()
619 if (ICI->getPredicate() == ICmpInst::ICMP_EQ) in transformZExtICmp()
845 if (ICmpInst *ICI = dyn_cast<ICmpInst>(Src)) in visitZExt()
852 ICmpInst *LHS = dyn_cast<ICmpInst>(SrcI->getOperand(0)); in visitZExt()
853 ICmpInst *RHS = dyn_cast<ICmpInst>(SrcI->getOperand(1)); in visitZExt()
[all …]
/external/llvm/lib/IR/
DConstantFold.cpp1376 static ICmpInst::Predicate areGlobalsPotentiallyEqual(const GlobalValue *GV1, in areGlobalsPotentiallyEqual()
1396 return ICmpInst::ICMP_NE; in areGlobalsPotentiallyEqual()
1397 return ICmpInst::BAD_ICMP_PREDICATE; in areGlobalsPotentiallyEqual()
1412 static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2, in evaluateICmpRelation()
1416 if (V1 == V2) return ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1425 ICmpInst::Predicate pred = ICmpInst::ICMP_EQ; in evaluateICmpRelation()
1429 pred = isSigned ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT; in evaluateICmpRelation()
1433 pred = isSigned ? ICmpInst::ICMP_SGT : ICmpInst::ICMP_UGT; in evaluateICmpRelation()
1439 return ICmpInst::BAD_ICMP_PREDICATE; in evaluateICmpRelation()
1443 ICmpInst::Predicate SwappedRelation = in evaluateICmpRelation()
[all …]
DInstructions.cpp3043 return new ICmpInst(InsertBefore, CmpInst::Predicate(predicate), in Create()
3046 return new ICmpInst(CmpInst::Predicate(predicate), in Create()
3062 return new ICmpInst(*InsertAtEnd, CmpInst::Predicate(predicate), in Create()
3070 if (ICmpInst *IC = dyn_cast<ICmpInst>(this)) in swapOperands()
3077 if (const ICmpInst *IC = dyn_cast<ICmpInst>(this)) in isCommutative()
3083 if (const ICmpInst *IC = dyn_cast<ICmpInst>(this)) in isEquality()
3122 ICmpInst::Predicate ICmpInst::getSignedPredicate(Predicate pred) { in getSignedPredicate()
3135 ICmpInst::Predicate ICmpInst::getUnsignedPredicate(Predicate pred) { in getUnsignedPredicate()
3151 ICmpInst::makeConstantRange(Predicate pred, const APInt &C) { in makeConstantRange()
3157 case ICmpInst::ICMP_EQ: ++Upper; break; in makeConstantRange()
[all …]
/external/llvm/lib/Analysis/
DInstructionSimplify.cpp1450 static Value *simplifyUnsignedRangeCheck(ICmpInst *ZeroICmp, in simplifyUnsignedRangeCheck()
1451 ICmpInst *UnsignedICmp, bool IsAnd) { in simplifyUnsignedRangeCheck()
1454 ICmpInst::Predicate EqPred; in simplifyUnsignedRangeCheck()
1456 !ICmpInst::isEquality(EqPred)) in simplifyUnsignedRangeCheck()
1459 ICmpInst::Predicate UnsignedPred; in simplifyUnsignedRangeCheck()
1461 ICmpInst::isUnsigned(UnsignedPred)) in simplifyUnsignedRangeCheck()
1465 ICmpInst::isUnsigned(UnsignedPred)) in simplifyUnsignedRangeCheck()
1466 UnsignedPred = ICmpInst::getSwappedPredicate(UnsignedPred); in simplifyUnsignedRangeCheck()
1472 if (UnsignedPred == ICmpInst::ICMP_ULT && EqPred == ICmpInst::ICMP_NE) in simplifyUnsignedRangeCheck()
1477 if (UnsignedPred == ICmpInst::ICMP_UGE && !IsAnd) { in simplifyUnsignedRangeCheck()
[all …]
DScalarEvolution.cpp1157 ICmpInst::Predicate *Pred, in getSignedOverflowLimitForStep()
1161 *Pred = ICmpInst::ICMP_SLT; in getSignedOverflowLimitForStep()
1166 *Pred = ICmpInst::ICMP_SGT; in getSignedOverflowLimitForStep()
1177 ICmpInst::Predicate *Pred, in getUnsignedOverflowLimitForStep()
1180 *Pred = ICmpInst::ICMP_ULT; in getUnsignedOverflowLimitForStep()
1212 ICmpInst::Predicate *Pred, in getOverflowLimitForStep()
1228 ICmpInst::Predicate *Pred, in getOverflowLimitForStep()
1305 ICmpInst::Predicate Pred; in getPreStartForExtend()
1398 ICmpInst::Predicate Pred = ICmpInst::BAD_ICMP_PREDICATE; in proveNoWrapByVaryingStart()
1529 if (isLoopBackedgeGuardedByCond(L, ICmpInst::ICMP_ULT, AR, N) || in getZeroExtendExpr()
[all …]
DLazyValueInfo.cpp717 static bool getValueFromFromCondition(Value *Val, ICmpInst *ICI,
739 if (ICmpInst *ICI = dyn_cast<ICmpInst>(C)) { in mergeAssumeBlockValueConstantRange()
835 bool getValueFromFromCondition(Value *Val, ICmpInst *ICI, in getValueFromFromCondition()
841 if (isTrueDest == (ICI->getPredicate() == ICmpInst::ICMP_EQ)) in getValueFromFromCondition()
851 if (ICI->getPredicate() == ICmpInst::ICMP_ULT) in getValueFromFromCondition()
901 if (ICmpInst *ICI = dyn_cast<ICmpInst>(BI->getCondition())) in getEdgeValueLocal()
1199 if (Pred == ICmpInst::ICMP_EQ) { in getPredicateResult()
1205 } else if (Pred == ICmpInst::ICMP_NE) { in getPredicateResult()
1215 ICmpInst::makeConstantRange((ICmpInst::Predicate)Pred, CI->getValue()); in getPredicateResult()
1226 if (Pred == ICmpInst::ICMP_EQ) { in getPredicateResult()
[all …]
DValueTracking.cpp474 inline match_combine_or<CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate>,
475 CmpClass_match<RHS, LHS, ICmpInst, ICmpInst::Predicate>>
476 m_c_ICmp(ICmpInst::Predicate &Pred, const LHS &L, const RHS &R) { in m_c_ICmp()
504 static void computeKnownBitsFromTrueCondition(Value *V, ICmpInst *Cmp, in computeKnownBitsFromTrueCondition()
526 case ICmpInst::ICMP_SGT: in computeKnownBitsFromTrueCondition()
536 case ICmpInst::ICMP_EQ: in computeKnownBitsFromTrueCondition()
544 case ICmpInst::ICMP_ULE: in computeKnownBitsFromTrueCondition()
553 case ICmpInst::ICMP_ULT: in computeKnownBitsFromTrueCondition()
620 ICmpInst *Cmp = dyn_cast<ICmpInst>(BI->getCondition()); in computeKnownBitsFromDominatingCondition()
646 ICmpInst *Cmp = dyn_cast<ICmpInst>(U); in computeKnownBitsFromDominatingCondition()
[all …]
/external/llvm/lib/Transforms/Scalar/
DInductiveRangeCheckElimination.cpp125 static RangeCheckKind parseRangeCheckICmp(Loop *L, ICmpInst *ICI,
259 InductiveRangeCheck::parseRangeCheckICmp(Loop *L, ICmpInst *ICI, in parseRangeCheckICmp()
274 ICmpInst::Predicate Pred = ICI->getPredicate(); in parseRangeCheckICmp()
282 case ICmpInst::ICMP_SLE: in parseRangeCheckICmp()
285 case ICmpInst::ICMP_SGE: in parseRangeCheckICmp()
292 case ICmpInst::ICMP_SLT: in parseRangeCheckICmp()
295 case ICmpInst::ICMP_SGT: in parseRangeCheckICmp()
308 case ICmpInst::ICMP_ULT: in parseRangeCheckICmp()
311 case ICmpInst::ICMP_UGT: in parseRangeCheckICmp()
337 ICmpInst *ICmpA = dyn_cast<ICmpInst>(A), *ICmpB = dyn_cast<ICmpInst>(B); in parseRangeCheck()
[all …]
DLoopIdiomRecognize.cpp318 ICmpInst *Cond = dyn_cast<ICmpInst>(Br->getCondition()); in matchCondition()
326 ICmpInst::Predicate Pred = Cond->getPredicate(); in matchCondition()
327 if ((Pred == ICmpInst::ICMP_NE && Br->getSuccessor(0) == LoopEntry) || in matchCondition()
328 (Pred == ICmpInst::ICMP_EQ && Br->getSuccessor(1) == LoopEntry)) in matchCondition()
502 ICmpInst *PreCond = cast<ICmpInst>(PreCondBr->getCondition()); in transform()
509 ICmpInst *NewPreCond = in transform()
510 cast<ICmpInst>(Builder.CreateICmp(PreCond->getPredicate(), Opnd0, Opnd1)); in transform()
539 ICmpInst *LbCond = cast<ICmpInst>(LbBr->getCondition()); in transform()
DIndVarSimplify.cpp410 ICmpInst *NewCompare = new ICmpInst(TheBr, NewPred, NewAdd, in HandleFloatingPointIV()
958 ICmpInst *Cmp = dyn_cast<ICmpInst>(DU.NarrowUse); in WidenLoopCompare()
1348 static ICmpInst *getLoopTest(Loop *L) { in getLoopTest()
1359 return dyn_cast<ICmpInst>(BI->getCondition()); in getLoopTest()
1366 ICmpInst *Cond = getLoopTest(L); in needsLFTR()
1371 ICmpInst::Predicate Pred = Cond->getPredicate(); in needsLFTR()
1372 if (Pred != ICmpInst::ICMP_NE && Pred != ICmpInst::ICMP_EQ) in needsLFTR()
1519 if (ICmpInst *Cond = getLoopTest(L)) { in FindLoopCounter()
1671 ICmpInst::Predicate P; in LinearFunctionTestReplace()
1673 P = ICmpInst::ICMP_NE; in LinearFunctionTestReplace()
[all …]
/external/llvm/lib/CodeGen/
DAnalysis.cpp198 ISD::CondCode llvm::getICmpCondCode(ICmpInst::Predicate Pred) { in getICmpCondCode()
200 case ICmpInst::ICMP_EQ: return ISD::SETEQ; in getICmpCondCode()
201 case ICmpInst::ICMP_NE: return ISD::SETNE; in getICmpCondCode()
202 case ICmpInst::ICMP_SLE: return ISD::SETLE; in getICmpCondCode()
203 case ICmpInst::ICMP_ULE: return ISD::SETULE; in getICmpCondCode()
204 case ICmpInst::ICMP_SGE: return ISD::SETGE; in getICmpCondCode()
205 case ICmpInst::ICMP_UGE: return ISD::SETUGE; in getICmpCondCode()
206 case ICmpInst::ICMP_SLT: return ISD::SETLT; in getICmpCondCode()
207 case ICmpInst::ICMP_ULT: return ISD::SETULT; in getICmpCondCode()
208 case ICmpInst::ICMP_SGT: return ISD::SETGT; in getICmpCondCode()
[all …]
/external/llvm/include/llvm/Analysis/
DScalarEvolution.h465 ICmpInst *ExitCond,
483 ICmpInst::Predicate p);
522 bool isImpliedCond(ICmpInst::Predicate Pred,
530 bool isImpliedCondOperands(ICmpInst::Predicate Pred,
537 bool isImpliedCondOperandsHelper(ICmpInst::Predicate Pred,
546 bool isImpliedCondOperandsViaRanges(ICmpInst::Predicate Pred,
562 bool isKnownPredicateWithRanges(ICmpInst::Predicate Pred,
759 bool isLoopEntryGuardedByCond(const Loop *L, ICmpInst::Predicate Pred,
765 bool isLoopBackedgeGuardedByCond(const Loop *L, ICmpInst::Predicate Pred,
890 bool isKnownPredicate(ICmpInst::Predicate Pred,
[all …]
/external/llvm/include/llvm/Transforms/Utils/
DCmpInstAnalysis.h21 class ICmpInst; variable
47 unsigned getICmpCode(const ICmpInst *ICI, bool InvertPred = false);
/external/llvm/include/llvm/IR/
DPatternMatch.h725 inline CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate>
726 m_ICmp(ICmpInst::Predicate &Pred, const LHS &L, const RHS &R) { in m_ICmp()
727 return CmpClass_match<LHS, RHS, ICmpInst, ICmpInst::Predicate>(Pred, L, R); in m_ICmp()
986 static bool match(ICmpInst::Predicate Pred) { in match()
993 static bool match(ICmpInst::Predicate Pred) { in match()
1000 static bool match(ICmpInst::Predicate Pred) { in match()
1007 static bool match(ICmpInst::Predicate Pred) { in match()
1041 inline MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty> m_SMax(const LHS &L, in m_SMax()
1043 return MaxMin_match<ICmpInst, LHS, RHS, smax_pred_ty>(L, R); in m_SMax()
1047 inline MaxMin_match<ICmpInst, LHS, RHS, smin_pred_ty> m_SMin(const LHS &L, in m_SMin()
[all …]
/external/llvm/unittests/IR/
DConstantRangeTest.cpp515 EXPECT_TRUE(ConstantRange::makeAllowedICmpRegion(ICmpInst::ICMP_SGT, SMax) in TEST()
524 EXPECT_EQ(ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_NE, LowHalf), in TEST()
528 ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_NE, HighHalf), in TEST()
531 EXPECT_TRUE(ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_EQ, in TEST()
536 EXPECT_EQ(ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_ULT, in TEST()
540 EXPECT_EQ(ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_ULE, in TEST()
544 EXPECT_EQ(ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_UGT, in TEST()
548 EXPECT_EQ(ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_UGE, in TEST()
555 ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_SLT, SignedSample), in TEST()
559 ConstantRange::makeSatisfyingICmpRegion(ICmpInst::ICMP_SLE, SignedSample), in TEST()
[all …]
DInstructionsTest.cpp314 ICmpInst *ICmp0 = new ICmpInst(ICmpInst::ICMP_SGT, PtrVecA, PtrVecB); in TEST()
315 ICmpInst *ICmp1 = new ICmpInst(ICmpInst::ICMP_ULT, PtrVecA, PtrVecB); in TEST()
320 ICmpInst *ICmp2 = new ICmpInst(*BB0, ICmpInst::ICMP_SGE, PtrVecA, PtrVecB); in TEST()
/external/llvm/lib/Target/CppBackend/
DCPPBackend.cpp887 case ICmpInst::ICMP_EQ: Out << "EQ"; break; in printConstant()
888 case ICmpInst::ICMP_NE: Out << "NE"; break; in printConstant()
889 case ICmpInst::ICMP_SLT: Out << "SLT"; break; in printConstant()
890 case ICmpInst::ICMP_ULT: Out << "ULT"; break; in printConstant()
891 case ICmpInst::ICMP_SGT: Out << "SGT"; break; in printConstant()
892 case ICmpInst::ICMP_UGT: Out << "UGT"; break; in printConstant()
893 case ICmpInst::ICMP_SLE: Out << "SLE"; break; in printConstant()
894 case ICmpInst::ICMP_ULE: Out << "ULE"; break; in printConstant()
895 case ICmpInst::ICMP_SGE: Out << "SGE"; break; in printConstant()
896 case ICmpInst::ICMP_UGE: Out << "UGE"; break; in printConstant()
[all …]
/external/llvm/examples/Fibonacci/
Dfibonacci.cpp63 Value *CondInst = new ICmpInst(*BB, ICmpInst::ICMP_SLE, ArgX, Two, "cond"); in CreateFibFunction()

1234