mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-15 07:34:33 +00:00
Peephole optimize SUBmi{16,32} into SUBmi{16,32}b when immediate is 8
bits wide. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11548 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cacca82833
commit
e287a00440
@ -154,6 +154,7 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
|
||||
|
||||
|
||||
case X86::ADDmi16: case X86::ADDmi32:
|
||||
case X86::SUBmi16: case X86::SUBmi32:
|
||||
case X86::ANDmi16: case X86::ANDmi32:
|
||||
assert(MI->getNumOperands() == 5 && "These should all have 5 operands!");
|
||||
if (MI->getOperand(4).isImmediate()) {
|
||||
@ -165,6 +166,8 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
|
||||
default: assert(0 && "Unknown opcode value!");
|
||||
case X86::ADDmi16: Opcode = X86::ADDmi16b; break;
|
||||
case X86::ADDmi32: Opcode = X86::ADDmi32b; break;
|
||||
case X86::SUBmi16: Opcode = X86::SUBmi16b; break;
|
||||
case X86::SUBmi32: Opcode = X86::SUBmi32b; break;
|
||||
case X86::ANDmi16: Opcode = X86::ANDmi16b; break;
|
||||
case X86::ANDmi32: Opcode = X86::ANDmi32b; break;
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
|
||||
|
||||
|
||||
case X86::ADDmi16: case X86::ADDmi32:
|
||||
case X86::SUBmi16: case X86::SUBmi32:
|
||||
case X86::ANDmi16: case X86::ANDmi32:
|
||||
assert(MI->getNumOperands() == 5 && "These should all have 5 operands!");
|
||||
if (MI->getOperand(4).isImmediate()) {
|
||||
@ -165,6 +166,8 @@ bool PH::PeepholeOptimize(MachineBasicBlock &MBB,
|
||||
default: assert(0 && "Unknown opcode value!");
|
||||
case X86::ADDmi16: Opcode = X86::ADDmi16b; break;
|
||||
case X86::ADDmi32: Opcode = X86::ADDmi32b; break;
|
||||
case X86::SUBmi16: Opcode = X86::SUBmi16b; break;
|
||||
case X86::SUBmi32: Opcode = X86::SUBmi32b; break;
|
||||
case X86::ANDmi16: Opcode = X86::ANDmi16b; break;
|
||||
case X86::ANDmi32: Opcode = X86::ANDmi32b; break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user