Home
last modified time | relevance | path

Searched refs:hasNoSignedWrap (Results 1 – 25 of 59) sorted by relevance

123

/llvm-project-15.0.7/llvm/unittests/Transforms/Utils/
H A DCloningTest.cpp81 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 DScalarEvolutionExpanderTest.cpp378 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 DInstCombineMulDivRem.cpp165 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 DInstCombineAddSub.cpp904 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 DInstCombineShifts.cpp151 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 DInstCombineSimplifyDemanded.cpp518 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 DInstructionCombining.cpp277 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 DInstCombineCompares.cpp1998 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 DPoisonChecking.cpp109 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 DInstruction.cpp139 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 DOperator.cpp28 return OBO->hasNoUnsignedWrap() || OBO->hasNoSignedWrap(); in hasPoisonGeneratingFlags()
/llvm-project-15.0.7/llvm/unittests/IR/
H A DIRBuilderTest.cpp719 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 DInstructionsTest.cpp830 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 DInstructionSimplify.h80 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 DPHITransAddr.cpp259 bool isNSW = cast<BinaryOperator>(Inst)->hasNoSignedWrap(); in PHITranslateSubExpr()
433 Res->setHasNoSignedWrap(cast<BinaryOperator>(Inst)->hasNoSignedWrap()); in InsertPHITranslatedSubExpr()
H A DValueTracking.cpp1516 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 DDemandedBits.cpp210 if (S->hasNoSignedWrap()) in determineLiveOperandBits()
H A DInstructionSimplify.cpp1017 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 DScalarEvolution.cpp301 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 DStrategiesTest.cpp171 FoundNSW |= AddI->hasNoSignedWrap(); in checkModifyNoUnsignedAndNoSignedWrap()
/llvm-project-15.0.7/llvm/include/llvm/IR/
H A DOperator.h102 bool hasNoSignedWrap() const { in hasNoSignedWrap() function
H A DInstruction.h370 bool hasNoSignedWrap() const;
/llvm-project-15.0.7/llvm/test/Transforms/InstCombine/
H A Dsub-ashr-and-to-icmp-select.ll5 …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 DLoopIdiomRecognize.cpp2533 if (XNext->hasNoSignedWrap() || XNext->hasNoUnsignedWrap() || in recognizeShiftUntilBitTest()
2672 (NBits->hasNoSignedWrap() || NBits->hasNoUnsignedWrap())) in detectShiftUntilZeroIdiom()
2677 NBits->hasNoSignedWrap()) in detectShiftUntilZeroIdiom()
H A DIndVarSimplify.cpp1107 if (BO->hasNoSignedWrap()) in linearFunctionTestReplace()
1108 BO->setHasNoSignedWrap(AR->hasNoSignedWrap()); in linearFunctionTestReplace()

123