| /llvm-project-15.0.7/llvm/unittests/Transforms/Utils/ |
| H A D | CloningTest.cpp | 81 EXPECT_FALSE(AddClone->hasNoSignedWrap()); in TEST_F() 83 EXPECT_FALSE(SubClone->hasNoSignedWrap()); in TEST_F() 85 EXPECT_FALSE(MulClone->hasNoSignedWrap()); in TEST_F() 98 EXPECT_FALSE(AddClone->hasNoSignedWrap()); in TEST_F() 100 EXPECT_FALSE(SubClone->hasNoSignedWrap()); in TEST_F() 115 EXPECT_TRUE(AddClone->hasNoSignedWrap()); in TEST_F() 117 EXPECT_TRUE(SubClone->hasNoSignedWrap()); in TEST_F() 119 EXPECT_TRUE(MulClone->hasNoSignedWrap()); in TEST_F() 132 EXPECT_TRUE(AddClone->hasNoSignedWrap()); in TEST_F() 134 EXPECT_TRUE(SubClone->hasNoSignedWrap()); in TEST_F() [all …]
|
| H A D | ScalarEvolutionExpanderTest.cpp | 378 EXPECT_FALSE(I->hasNoSignedWrap()); in TEST_F() 480 EXPECT_FALSE(I->hasNoSignedWrap()); in TEST_F() 703 EXPECT_TRUE(cast<SCEVMulExpr>(AndSCEV)->hasNoSignedWrap()); in TEST_F() 708 EXPECT_FALSE(I->hasNoSignedWrap()); in TEST_F()
|
| /llvm-project-15.0.7/llvm/lib/Transforms/InstCombine/ |
| H A D | InstCombineMulDivRem.cpp | 165 if (I.hasNoSignedWrap()) in visitMul() 184 if (I.hasNoSignedWrap() && Mul->hasNoSignedWrap() && in visitMul() 197 if (I.hasNoSignedWrap()) { in visitMul() 257 if (I.hasNoSignedWrap() && in visitMul() 258 cast<OverflowingBinaryOperator>(Op0)->hasNoSignedWrap() && in visitMul() 259 cast<OverflowingBinaryOperator>(Op1)->hasNoSignedWrap()) in visitMul() 323 ShlNSW = cast<ShlOperator>(Op0)->hasNoSignedWrap(); in visitMul() 326 ShlNSW = cast<ShlOperator>(Op1)->hasNoSignedWrap(); in visitMul() 331 if (I.hasNoSignedWrap() && ShlNSW) in visitMul() 839 Mul->setHasNoSignedWrap(OBO->hasNoSignedWrap()); in commonIDivTransforms() [all …]
|
| H A D | InstCombineAddSub.cpp | 904 if (Add.hasNoSignedWrap() || Add.hasNoUnsignedWrap()) in foldAddWithConstant() 1256 bool HasNSW = I.hasNoSignedWrap() && Op0->hasNoSignedWrap() && in factorizeMathWithShlOps() 1257 Op1->hasNoSignedWrap(); in factorizeMathWithShlOps() 1275 I.hasNoSignedWrap(), I.hasNoUnsignedWrap(), in visitAdd() 1309 Shl->setHasNoSignedWrap(I.hasNoSignedWrap()); in visitAdd() 1431 if (!I.hasNoSignedWrap() && willNotOverflowSignedAdd(LHS, RHS, I)) { in visitAdd() 1802 I.hasNoSignedWrap(), I.hasNoUnsignedWrap(), in visitSub() 1822 if (BO->hasNoSignedWrap() && I.hasNoSignedWrap()) in visitSub() 1825 if (cast<Constant>(Op1)->isNotMinSignedValue() && I.hasNoSignedWrap()) in visitSub() 1851 if (!I.hasNoSignedWrap() && willNotOverflowSignedSub(Op0, Op1, I)) { in visitSub() [all …]
|
| H A D | InstCombineShifts.cpp | 151 NewShift->setHasNoSignedWrap(Sh0->hasNoSignedWrap() && in reassociateShiftAmtsOfTwoSameDirectionShifts() 152 Sh1->hasNoSignedWrap()); in reassociateShiftAmtsOfTwoSameDirectionShifts() 431 return (I.hasNoSignedWrap() || I.hasNoUnsignedWrap()) && in commonShiftTransforms() 833 I.hasNoSignedWrap(), I.hasNoUnsignedWrap(), Q)) in visitShl() 878 NewShl->setHasNoSignedWrap(I.hasNoSignedWrap()); in visitShl() 899 NewShl->setHasNoSignedWrap(I.hasNoSignedWrap()); in visitShl() 1019 if (!I.hasNoSignedWrap() && ComputeNumSignBits(Op0, 0, &I) > ShAmtC) { in visitShl() 1251 NewMul->setHasNoSignedWrap(OrigMul->hasNoSignedWrap()); in visitLShr()
|
| H A D | InstCombineSimplifyDemanded.cpp | 518 bool NSW = cast<OverflowingBinaryOperator>(I)->hasNoSignedWrap(); in SimplifyDemandedUseBits() 587 if (IOp->hasNoSignedWrap()) in SimplifyDemandedUseBits() 606 if (IOp->hasNoSignedWrap()) { in SimplifyDemandedUseBits() 1142 New->setHasNoSignedWrap(Orig->hasNoSignedWrap()); in simplifyShrShlDemandedBits()
|
| H A D | InstructionCombining.cpp | 277 if (!OBO || !OBO->hasNoSignedWrap()) in maintainNoSignedWrap() 303 static bool hasNoSignedWrap(BinaryOperator &I) { in hasNoSignedWrap() function 305 return OBO && OBO->hasNoSignedWrap(); in hasNoSignedWrap() 434 bool IsNSW = maintainNoSignedWrap(I, B, C) && hasNoSignedWrap(*Op0); in SimplifyAssociativeOrCommutative() 698 HasNSW = I.hasNoSignedWrap(); in tryFactorization() 703 HasNSW &= LOBO->hasNoSignedWrap(); in tryFactorization() 708 HasNSW &= ROBO->hasNoSignedWrap(); in tryFactorization() 1489 NoSignedWrap = BO->hasNoSignedWrap(); in Descale() 1528 NoSignedWrap = BO->hasNoSignedWrap(); in Descale() 1639 bool OpNoSignedWrap = BO->hasNoSignedWrap(); in Descale()
|
| H A D | InstCombineCompares.cpp | 1998 if (isSignTest(Pred, C) && Mul->hasNoSignedWrap()) { in foldICmpMulConstant() 2012 if (Mul->hasNoSignedWrap() && C.srem(*MulC).isZero()) { in foldICmpMulConstant() 2028 if (Mul->hasNoSignedWrap()) { in foldICmpMulConstant() 2144 if (Shl->hasNoSignedWrap()) { in foldICmpShlConstant() 2700 bool HasNSW = Sub->hasNoSignedWrap(); in foldICmpSubConstant() 2725 if (Sub->hasNoSignedWrap()) { in foldICmpSubConstant() 2782 if ((Add->hasNoSignedWrap() && in foldICmpAddConstant() 4282 bool HasNSW = BO0->hasNoSignedWrap(); in foldICmpBinOp() 4289 bool HasNSW = BO1->hasNoSignedWrap(); in foldICmpBinOp() 4368 (BO0 && BO1 && BO0->hasNoSignedWrap() && BO1->hasNoSignedWrap()) || in foldICmpBinOp() [all …]
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Instrumentation/ |
| H A D | PoisonChecking.cpp | 109 if (I.hasNoSignedWrap()) { in generateCreationChecksForBinOp() 122 if (I.hasNoSignedWrap()) { in generateCreationChecksForBinOp() 135 if (I.hasNoSignedWrap()) { in generateCreationChecksForBinOp()
|
| /llvm-project-15.0.7/llvm/lib/IR/ |
| H A D | Instruction.cpp | 139 bool Instruction::hasNoSignedWrap() const { in hasNoSignedWrap() function in Instruction 140 return cast<OverflowingBinaryOperator>(this)->hasNoSignedWrap(); in hasNoSignedWrap() 302 setHasNoSignedWrap(OB->hasNoSignedWrap()); in copyIRFlags() 325 setHasNoSignedWrap(hasNoSignedWrap() && OB->hasNoSignedWrap()); in andIRFlags()
|
| H A D | Operator.cpp | 28 return OBO->hasNoUnsignedWrap() || OBO->hasNoSignedWrap(); in hasPoisonGeneratingFlags()
|
| /llvm-project-15.0.7/llvm/unittests/IR/ |
| H A D | IRBuilderTest.cpp | 719 cast<BinaryOperator>(Builder.CreateNSWAdd(V, V))->hasNoSignedWrap()); in TEST_F() 721 cast<BinaryOperator>(Builder.CreateNSWMul(V, V))->hasNoSignedWrap()); in TEST_F() 723 cast<BinaryOperator>(Builder.CreateNSWSub(V, V))->hasNoSignedWrap()); in TEST_F() 726 ->hasNoSignedWrap()); in TEST_F() 741 ->hasNoSignedWrap()); in TEST_F() 743 ->hasNoSignedWrap()); in TEST_F() 745 ->hasNoSignedWrap()); in TEST_F() 748 ->hasNoSignedWrap()); in TEST_F()
|
| H A D | InstructionsTest.cpp | 830 ASSERT_FALSE(AI->hasNoSignedWrap()); in TEST_F() 836 ASSERT_TRUE(SI->hasNoSignedWrap()); in TEST_F() 839 ASSERT_FALSE(SI->hasNoSignedWrap()); in TEST_F() 845 ASSERT_TRUE(ShlI->hasNoSignedWrap()); in TEST_F() 849 ASSERT_FALSE(ShlI->hasNoSignedWrap()); in TEST_F()
|
| /llvm-project-15.0.7/llvm/include/llvm/Analysis/ |
| H A D | InstructionSimplify.h | 80 template <class InstT> bool hasNoSignedWrap(const InstT *Op) const { in hasNoSignedWrap() function 82 return Op->hasNoSignedWrap(); in hasNoSignedWrap()
|
| /llvm-project-15.0.7/llvm/lib/Analysis/ |
| H A D | PHITransAddr.cpp | 259 bool isNSW = cast<BinaryOperator>(Inst)->hasNoSignedWrap(); in PHITranslateSubExpr() 433 Res->setHasNoSignedWrap(cast<BinaryOperator>(Inst)->hasNoSignedWrap()); in InsertPHITranslatedSubExpr()
|
| H A D | ValueTracking.cpp | 1516 if (OverflowOp && Q.IIQ.hasNoSignedWrap(OverflowOp)) { in computeKnownBitsFromOperator() 2069 Q.IIQ.hasNoSignedWrap(BO)) && in isPowerOfTwoRecurrence() 2160 Q.IIQ.hasNoSignedWrap(VOBO)) { in isKnownToBeAPowerOfTwo() 2416 return (BO->hasNoUnsignedWrap() || BO->hasNoSignedWrap()) && in isNonZeroRecurrence() 2419 return BO->hasNoUnsignedWrap() || BO->hasNoSignedWrap(); in isNonZeroRecurrence() 2756 (!OBO1->hasNoSignedWrap() || !OBO2->hasNoSignedWrap())) in getInvertibleOperands() 2772 (!OBO1->hasNoSignedWrap() || !OBO2->hasNoSignedWrap())) in getInvertibleOperands() 2853 (OBO->hasNoUnsignedWrap() || OBO->hasNoSignedWrap()) && in isNonEqualMul() 4920 if (Add && Add->hasNoSignedWrap()) { in computeOverflowForSignedAdd() 6890 bool HasNSW = IIQ.hasNoSignedWrap(&BO); in setLimitsForBinOp() [all …]
|
| H A D | DemandedBits.cpp | 210 if (S->hasNoSignedWrap()) in determineLiveOperandBits()
|
| H A D | InstructionSimplify.cpp | 1017 if ((IsSigned && Q.IIQ.hasNoSignedWrap(Mul)) || in simplifyDivRem() 1718 bool isNSW = IIQ.hasNoSignedWrap(AddInst); in simplifyAndOfICmpsWithAdd() 1880 bool isNSW = IIQ.hasNoSignedWrap(AddInst); in simplifyOrOfICmpsWithAdd() 3209 Q.IIQ.hasNoSignedWrap(cast<OverflowingBinaryOperator>(LBO))); in simplifyICmpWithBinOp() 3219 Q.IIQ.hasNoSignedWrap(cast<OverflowingBinaryOperator>(RBO))); in simplifyICmpWithBinOp() 3307 if (Q.IIQ.hasNoSignedWrap(cast<OverflowingBinaryOperator>(LBO)) || in simplifyICmpWithBinOp() 3358 bool NSW = Q.IIQ.hasNoSignedWrap(LBO) && Q.IIQ.hasNoSignedWrap(RBO); in simplifyICmpWithBinOp() 6317 NewOps[0], NewOps[1], Q.IIQ.hasNoSignedWrap(cast<BinaryOperator>(I)), in simplifyInstructionWithOperands() 6325 NewOps[0], NewOps[1], Q.IIQ.hasNoSignedWrap(cast<BinaryOperator>(I)), in simplifyInstructionWithOperands() 6354 NewOps[0], NewOps[1], Q.IIQ.hasNoSignedWrap(cast<BinaryOperator>(I)), in simplifyInstructionWithOperands()
|
| H A D | ScalarEvolution.cpp | 301 if (AR->hasNoSignedWrap()) in print() 346 if (NAry->hasNoSignedWrap()) in print() 1949 if (SA->hasNoSignedWrap()) { in getSignExtendExpr() 1998 if (AR->hasNoSignedWrap()) { in getSignExtendExpr() 2333 if (OBO->hasNoSignedWrap()) in getStrengthenedNoWrapFlagsFromBinOp() 2353 if (!OBO->hasNoSignedWrap() && in getStrengthenedNoWrapFlagsFromBinOp() 4928 if (!AR->hasNoSignedWrap()) { in proveNoWrapViaConstantRanges() 4955 if (AR->hasNoSignedWrap()) in proveNoSignedWrapViaInduction() 6436 if (Add->hasNoSignedWrap()) in getRangeRef() 6960 if (BinOp->hasNoSignedWrap()) in getNoWrapFlagsFromUB() [all …]
|
| /llvm-project-15.0.7/llvm/unittests/FuzzMutate/ |
| H A D | StrategiesTest.cpp | 171 FoundNSW |= AddI->hasNoSignedWrap(); in checkModifyNoUnsignedAndNoSignedWrap()
|
| /llvm-project-15.0.7/llvm/include/llvm/IR/ |
| H A D | Operator.h | 102 bool hasNoSignedWrap() const { in hasNoSignedWrap() function
|
| H A D | Instruction.h | 370 bool hasNoSignedWrap() const;
|
| /llvm-project-15.0.7/llvm/test/Transforms/InstCombine/ |
| H A D | sub-ashr-and-to-icmp-select.ll | 5 …clamp0 implemented in a shifty way, could be optimized as v > 0 ? v : 0, where sub hasNoSignedWrap.
|
| /llvm-project-15.0.7/llvm/lib/Transforms/Scalar/ |
| H A D | LoopIdiomRecognize.cpp | 2533 if (XNext->hasNoSignedWrap() || XNext->hasNoUnsignedWrap() || in recognizeShiftUntilBitTest() 2672 (NBits->hasNoSignedWrap() || NBits->hasNoUnsignedWrap())) in detectShiftUntilZeroIdiom() 2677 NBits->hasNoSignedWrap()) in detectShiftUntilZeroIdiom()
|
| H A D | IndVarSimplify.cpp | 1107 if (BO->hasNoSignedWrap()) in linearFunctionTestReplace() 1108 BO->setHasNoSignedWrap(AR->hasNoSignedWrap()); in linearFunctionTestReplace()
|