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:
Alkis Evlogimenos 2004-02-17 15:14:29 +00:00
parent cacca82833
commit e287a00440
2 changed files with 6 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}