mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-01 21:03:54 +00:00
make this 64 bit clean, fixed test30 of /Regression/Transforms/InstCombine/add.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24158 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e8148bc291
commit
7bbff04f7f
@ -710,7 +710,7 @@ Instruction *InstCombiner::visitAdd(BinaryOperator &I) {
|
||||
// X + (signbit) --> X ^ signbit
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(RHSC)) {
|
||||
unsigned NumBits = CI->getType()->getPrimitiveSizeInBits();
|
||||
uint64_t Val = CI->getRawValue() & (1ULL << NumBits)-1;
|
||||
uint64_t Val = CI->getRawValue() & (~0ULL >> (64- NumBits));
|
||||
if (Val == (1ULL << (NumBits-1)))
|
||||
return BinaryOperator::createXor(LHS, RHS);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user