Hi Dan, Is this necessary? ARM is already doing this by marking trivially re- materializable instructions with let isReMaterializable = 1.
Evan On Jun 14, 2007, at 1:51 PM, Dan Gohman wrote: > > > Changes in directory llvm/lib/CodeGen: > > LiveIntervalAnalysis.cpp updated: 1.246 -> 1.247 > VirtRegMap.cpp updated: 1.111 -> 1.112 > --- > Log message: > > Add a target hook to allow loads from constant pools to be > rematerialized, and an > implementation for x86. > > > --- > Diffs of the changes: (+6 -3) > > LiveIntervalAnalysis.cpp | 6 ++++-- > VirtRegMap.cpp | 3 ++- > 2 files changed, 6 insertions(+), 3 deletions(-) > > > Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp > diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.246 llvm/lib/ > CodeGen/LiveIntervalAnalysis.cpp:1.247 > --- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.246 Fri Jun 8 > 12:18:56 2007 > +++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp Thu Jun 14 15:50:44 2007 > @@ -336,12 +336,14 @@ > // time we see a vreg. > if (interval.empty()) { > // Remember if the definition can be rematerialized. All > load's from fixed > - // stack slots are re-materializable. > + // stack slots are re-materializable. The target may permit > other loads to > + // be re-materialized as well. > int FrameIdx = 0; > if (vi.DefInst && > (tii_->isReMaterializable(vi.DefInst->getOpcode()) || > (tii_->isLoadFromStackSlot(vi.DefInst, FrameIdx) && > - mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)))) > + mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)) || > + tii_->isOtherReMaterializableLoad(vi.DefInst))) > interval.remat = vi.DefInst; > > // Get the Idx of the defining instructions. > > > Index: llvm/lib/CodeGen/VirtRegMap.cpp > diff -u llvm/lib/CodeGen/VirtRegMap.cpp:1.111 llvm/lib/CodeGen/ > VirtRegMap.cpp:1.112 > --- llvm/lib/CodeGen/VirtRegMap.cpp:1.111 Thu Apr 26 13:59:33 2007 > +++ llvm/lib/CodeGen/VirtRegMap.cpp Thu Jun 14 15:50:44 2007 > @@ -664,7 +664,8 @@ > // If this instruction is being rematerialized, just remove it! > int FrameIdx; > if ((TID->Flags & M_REMATERIALIZIBLE) || > - TII->isLoadFromStackSlot(&MI, FrameIdx)) { > + TII->isLoadFromStackSlot(&MI, FrameIdx) || > + TII->isOtherReMaterializableLoad(&MI)) { > bool Remove = true; > for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) { > MachineOperand &MO = MI.getOperand(i); > > > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits