[llvm-commits] [llvm] r131578 - /llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
Cameron Zwarich
zwarich at apple.com
Wed May 18 14:25:14 PDT 2011
Author: zwarich
Date: Wed May 18 16:25:14 2011
New Revision: 131578
URL: http://llvm.org/viewvc/llvm-project?rev=131578&view=rev
Log:
Fix more of PR8825. Now all of CodeGen/ARM passes with VerifyCoalescing turned on.
Modified:
llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp?rev=131578&r1=131577&r2=131578&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMLoadStoreOptimizer.cpp Wed May 18 16:25:14 2011
@@ -1672,10 +1672,14 @@
Ops.pop_back();
Ops.pop_back();
+ const TargetInstrDesc &TID = TII->get(NewOpc);
+ const TargetRegisterClass *TRC = TID.OpInfo[0].getRegClass(TRI);
+ MRI->constrainRegClass(EvenReg, TRC);
+ MRI->constrainRegClass(OddReg, TRC);
+
// Form the pair instruction.
if (isLd) {
- MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos,
- dl, TII->get(NewOpc))
+ MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos, dl, TID)
.addReg(EvenReg, RegState::Define)
.addReg(OddReg, RegState::Define)
.addReg(BaseReg);
@@ -1687,8 +1691,7 @@
MIB.addImm(Offset).addImm(Pred).addReg(PredReg);
++NumLDRDFormed;
} else {
- MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos,
- dl, TII->get(NewOpc))
+ MachineInstrBuilder MIB = BuildMI(*MBB, InsertPos, dl, TID)
.addReg(EvenReg)
.addReg(OddReg)
.addReg(BaseReg);
More information about the llvm-commits
mailing list