diff options
author | Chris Lattner <sabre@nondot.org> | 2009-08-31 04:36:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-08-31 04:36:22 +0000 |
commit | 95afdfee8260c5daad485b9eb6c5340f33ad5186 (patch) | |
tree | aacdd1c127560315a09adc86d34a540c612f7c92 /lib/Transforms/Scalar | |
parent | 98a27ce03f092ab5464e65725f7d1fa0c03652f2 (diff) | |
download | external_llvm-95afdfee8260c5daad485b9eb6c5340f33ad5186.zip external_llvm-95afdfee8260c5daad485b9eb6c5340f33ad5186.tar.gz external_llvm-95afdfee8260c5daad485b9eb6c5340f33ad5186.tar.bz2 |
fix a bug I introduced with my 'instcombine builder' refactoring
changes: SimplifyDemandedBits can't use the builder yet because it
has the wrong insertion point. This fixes a crash building
MultiSource/Benchmarks/PAQ8p
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80537 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 1bfce5d..64f99e3 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1010,8 +1010,12 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, // If all of the demanded bits are known to be zero on one side or the // other, turn this into an *inclusive* or. // e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0 - if ((DemandedMask & ~RHSKnownZero & ~LHSKnownZero) == 0) - return Builder->CreateOr(I->getOperand(0), I->getOperand(1),I->getName()); + if ((DemandedMask & ~RHSKnownZero & ~LHSKnownZero) == 0) { + Instruction *Or = + BinaryOperator::CreateOr(I->getOperand(0), I->getOperand(1), + I->getName()); + return InsertNewInstBefore(Or, *I); + } // If all of the demanded bits on one side are known, and all of the set // bits on that side are also known to be set on the other side, turn this |