mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Little patch to turn (shl (add X, 123), 4) -> (add (shl X, 4), 123 << 4)
This triggers in cases of bitfield additions, opening opportunities for future improvements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16834 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d74634a885
commit
1f7e160f77
@ -2496,6 +2496,9 @@ Instruction *InstCombiner::visitShiftInst(ShiftInst &I) {
|
|||||||
|
|
||||||
switch (Op0BO->getOpcode()) {
|
switch (Op0BO->getOpcode()) {
|
||||||
default: isValid = false; break; // Do not perform transform!
|
default: isValid = false; break; // Do not perform transform!
|
||||||
|
case Instruction::Add:
|
||||||
|
isValid = isLeftShift;
|
||||||
|
break;
|
||||||
case Instruction::Or:
|
case Instruction::Or:
|
||||||
case Instruction::Xor:
|
case Instruction::Xor:
|
||||||
highBitSet = false;
|
highBitSet = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user