diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-08-03 19:15:42 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-08-03 19:15:42 +0000 |
commit | cfd3bbe64359a0816443711d2d16e4aafb467354 (patch) | |
tree | e654f41e6598f36c72315fce9a91bc18b904da1b | |
parent | 6782844874d9cf79cd1600b089d8aeb4f3666990 (diff) | |
download | bcm5719-llvm-cfd3bbe64359a0816443711d2d16e4aafb467354.tar.gz bcm5719-llvm-cfd3bbe64359a0816443711d2d16e4aafb467354.zip |
Make SimplifyDemandedUseBits generate vector constants where
appropriate. Patch per report on llvmdev. No testcase because the
original report didn't come with a testcase, and I can't come up with a case
that actually fails.
llvm-svn: 77986
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 0a6153db812..4d2248e2917 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1014,7 +1014,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) { // all known if ((RHSKnownOne & LHSKnownOne) == RHSKnownOne) { - Constant *AndC = ConstantInt::get(*Context, + Constant *AndC = ConstantInt::get(VTy, ~RHSKnownOne & DemandedMask); Instruction *And = BinaryOperator::CreateAnd(I->getOperand(0), AndC, "tmp"); @@ -1407,7 +1407,7 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, // If the client is only demanding bits that we know, return the known // constant. if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) { - Constant *C = ConstantInt::get(*Context, RHSKnownOne); + Constant *C = ConstantInt::get(VTy, RHSKnownOne); if (isa<PointerType>(V->getType())) C = ConstantExpr::getIntToPtr(C, V->getType()); return C; |