diff options
| author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-07-08 16:40:22 +0000 |
|---|---|---|
| committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-07-08 16:40:22 +0000 |
| commit | 00264624a90f4b9d243a93de7b963e8717b35c3b (patch) | |
| tree | 840e61e665c91df29ae90baa548c99e93f5705d1 /llvm/lib/CodeGen/OptimizeExts.cpp | |
| parent | a1e883dcf6aab2c09d6d90369e4429d54e025b45 (diff) | |
| download | bcm5719-llvm-00264624a90f4b9d243a93de7b963e8717b35c3b.tar.gz bcm5719-llvm-00264624a90f4b9d243a93de7b963e8717b35c3b.zip | |
Convert EXTRACT_SUBREG to COPY when emitting machine instrs.
EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.
Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.
llvm-svn: 107879
Diffstat (limited to 'llvm/lib/CodeGen/OptimizeExts.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/OptimizeExts.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/OptimizeExts.cpp b/llvm/lib/CodeGen/OptimizeExts.cpp index 38f3cf7e41c..dcdc243e5db 100644 --- a/llvm/lib/CodeGen/OptimizeExts.cpp +++ b/llvm/lib/CodeGen/OptimizeExts.cpp @@ -128,12 +128,12 @@ bool OptimizeExts::OptimizeInstr(MachineInstr *MI, MachineBasicBlock *MBB, // // %reg1025 = <sext> %reg1024 // ... - // %reg1027 = EXTRACT_SUBREG %reg1025, 4 + // %reg1027 = COPY %reg1025:4 // %reg1026 = SUBREG_TO_REG 0, %reg1027, 4 // // The problem here is that SUBREG_TO_REG is there to assert that an // implicit zext occurs. It doesn't insert a zext instruction. If we allow - // the EXTRACT_SUBREG here, it will give us the value after the <sext>, + // the COPY here, it will give us the value after the <sext>, // not the original value of %reg1024 before <sext>. if (UseMI->getOpcode() == TargetOpcode::SUBREG_TO_REG) continue; @@ -185,8 +185,8 @@ bool OptimizeExts::OptimizeInstr(MachineInstr *MI, MachineBasicBlock *MBB, continue; unsigned NewVR = MRI->createVirtualRegister(RC); BuildMI(*UseMBB, UseMI, UseMI->getDebugLoc(), - TII->get(TargetOpcode::EXTRACT_SUBREG), NewVR) - .addReg(DstReg).addImm(SubIdx); + TII->get(TargetOpcode::COPY), NewVR) + .addReg(DstReg, 0, SubIdx); UseMO->setReg(NewVR); ++NumReuse; Changed = true; |

