diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-07-16 20:15:00 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-07-16 20:15:00 +0000 |
commit | 6dbb7f62ad93f4034dff2825dd4d1f33c667cc5a (patch) | |
tree | d9f14e78d32e96dffee47ed9229ae6b381e8dc66 /lib/CodeGen | |
parent | 48db02d0d921faded40a05912717a380e0f62642 (diff) | |
download | external_llvm-6dbb7f62ad93f4034dff2825dd4d1f33c667cc5a.zip external_llvm-6dbb7f62ad93f4034dff2825dd4d1f33c667cc5a.tar.gz external_llvm-6dbb7f62ad93f4034dff2825dd4d1f33c667cc5a.tar.bz2 |
Changed my mind. We now allow remat of instructions whose defs have subreg indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 5 | ||||
-rw-r--r-- | lib/CodeGen/VirtRegRewriter.cpp | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 873e58e..d8f2089 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1157,11 +1157,6 @@ bool LiveIntervals::isReMaterializable(const LiveInterval &li, if (DisableReMat) return false; - // FIXME: For now, avoid remating instructions whose definition has a subreg - // index. It's just incredibly difficult to get right. - if (MI->findRegisterDefOperand(li.reg)->getSubReg()) - return false; - if (MI->getOpcode() == TargetInstrInfo::IMPLICIT_DEF) return true; diff --git a/lib/CodeGen/VirtRegRewriter.cpp b/lib/CodeGen/VirtRegRewriter.cpp index 800cdd6..a859d80 100644 --- a/lib/CodeGen/VirtRegRewriter.cpp +++ b/lib/CodeGen/VirtRegRewriter.cpp @@ -490,7 +490,14 @@ static void ReMaterialize(MachineBasicBlock &MBB, const TargetInstrInfo *TII, const TargetRegisterInfo *TRI, VirtRegMap &VRM) { - TII->reMaterialize(MBB, MII, DestReg, 0, VRM.getReMaterializedMI(Reg)); + MachineInstr *ReMatDefMI = VRM.getReMaterializedMI(Reg); +#ifdef NDEBUG + const TargetInstrDesc &TID = ReMatDefMI->getDesc(); + assert(TID.getNumDefs() != 1 && + "Don't know how to remat instructions that define > 1 values!"); +#endif + TII->reMaterialize(MBB, MII, DestReg, + ReMatDefMI->getOperand(0).getSubReg(), ReMatDefMI); MachineInstr *NewMI = prior(MII); for (unsigned i = 0, e = NewMI->getNumOperands(); i != e; ++i) { MachineOperand &MO = NewMI->getOperand(i); |