mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
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
This commit is contained in:
parent
a5a1e7b4ed
commit
af54b9b643
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user