diff options
| author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-01-12 07:22:45 +0000 |
|---|---|---|
| committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-01-12 07:22:45 +0000 |
| commit | 975c8bde79662ce0743e608f2bd7761210cfac59 (patch) | |
| tree | c6cf1951f975583104583b4907aba16ba538f681 /llvm/lib/Target | |
| parent | 69fba00b85edcdbdc02f822c77f560274b24b661 (diff) | |
| download | bcm5719-llvm-975c8bde79662ce0743e608f2bd7761210cfac59.tar.gz bcm5719-llvm-975c8bde79662ce0743e608f2bd7761210cfac59.zip | |
Output mov %REG = 0 instead of xor %REG, %REG, %REG to clear a
register so that LiveVariable analysis is not confused.
llvm-svn: 10773
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/InstSelectSimple.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/InstSelectSimple.cpp b/llvm/lib/Target/X86/InstSelectSimple.cpp index 0cd24813e95..745c219c4fb 100644 --- a/llvm/lib/Target/X86/InstSelectSimple.cpp +++ b/llvm/lib/Target/X86/InstSelectSimple.cpp @@ -1452,7 +1452,7 @@ void ISel::emitDivRemOperation(MachineBasicBlock *BB, static const unsigned Regs[] ={ X86::AL , X86::AX , X86::EAX }; static const unsigned MovOpcode[]={ X86::MOVrr8, X86::MOVrr16, X86::MOVrr32 }; static const unsigned SarOpcode[]={ X86::SARir8, X86::SARir16, X86::SARir32 }; - static const unsigned ClrOpcode[]={ X86::XORrr8, X86::XORrr16, X86::XORrr32 }; + static const unsigned ClrOpcode[]={ X86::MOVir8, X86::MOVir16, X86::MOVir32 }; static const unsigned ExtRegs[] ={ X86::AH , X86::DX , X86::EDX }; static const unsigned DivOpcode[][4] = { @@ -1473,8 +1473,8 @@ void ISel::emitDivRemOperation(MachineBasicBlock *BB, BMI(BB, IP, SarOpcode[Class], 2, ShiftResult).addReg(Op0Reg).addZImm(31); BMI(BB, IP, MovOpcode[Class], 1, ExtReg).addReg(ShiftResult); } else { - // If unsigned, emit a zeroing instruction... (reg = xor reg, reg) - BMI(BB, IP, ClrOpcode[Class], 2, ExtReg).addReg(ExtReg).addReg(ExtReg); + // If unsigned, emit a zeroing instruction... (reg = 0) + BMI(BB, IP, ClrOpcode[Class], 2, ExtReg).addZImm(0); } // Emit the appropriate divide or remainder instruction... |

