diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-03-24 22:12:10 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-03-24 22:12:10 +0000 |
| commit | 8fbb74b5b24183d7b2afbc36c690921d9690307e (patch) | |
| tree | b19a1760ac441b758b71a8d473077e223b9d1154 /llvm/lib/Transforms | |
| parent | 650599d84d93cc38fbb7abdab6b795d88f4bf48a (diff) | |
| download | bcm5719-llvm-8fbb74b5b24183d7b2afbc36c690921d9690307e.tar.gz bcm5719-llvm-8fbb74b5b24183d7b2afbc36c690921d9690307e.zip | |
Revert r298711 "[InstCombine] Provide a way to calculate KnownZero/One for Add/Sub in SimplifyDemandedUseBits without recursing into ComputeKnownBits"
Tsan bot is failing.
llvm-svn: 298745
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index d10fa06f0c2..41d4a4820bf 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -538,7 +538,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, LHSKnownZero, LHSKnownOne, Depth + 1) || ShrinkDemandedConstant(I, 1, DemandedFromOps) || SimplifyDemandedBits(I->getOperandUse(1), DemandedFromOps, - RHSKnownZero, RHSKnownOne, Depth + 1)) { + LHSKnownZero, LHSKnownOne, Depth + 1)) { // Disable the nsw and nuw flags here: We can no longer guarantee that // we won't wrap after simplification. Removing the nsw/nuw flags is // legal here because the top bit is not demanded. @@ -549,10 +549,9 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, } } - // Otherwise compute the known bits using the RHS/LHS known bits. - bool NSW = cast<OverflowingBinaryOperator>(I)->hasNoSignedWrap(); - computeKnownBitsForAddSub(V, NSW, KnownZero, KnownOne, LHSKnownZero, - LHSKnownOne, RHSKnownZero, RHSKnownOne); + // Otherwise just hand the add/sub off to computeKnownBits to fill in + // the known zeros and ones. + computeKnownBits(V, KnownZero, KnownOne, Depth, CxtI); break; } case Instruction::Shl: |

