mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
Treat xor of signbit like an add.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35586 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
febabcc02a
commit
2811f2a670
@ -1427,7 +1427,16 @@ SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Instruction::Xor:
|
||||
// If the RHS of the xor is a signbit, then this is just an add.
|
||||
// Instcombine turns add of signbit into xor as a strength reduction step.
|
||||
if (ConstantInt *CI = dyn_cast<ConstantInt>(I->getOperand(1))) {
|
||||
if (CI->getValue().isSignBit())
|
||||
return SCEVAddExpr::get(getSCEV(I->getOperand(0)),
|
||||
getSCEV(I->getOperand(1)));
|
||||
}
|
||||
break;
|
||||
|
||||
case Instruction::Shl:
|
||||
// Turn shift left of a constant amount into a multiply.
|
||||
if (ConstantInt *SA = dyn_cast<ConstantInt>(I->getOperand(1))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user