[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp VirtRegMap.cpp

Dan Gohman djg at cray.com
Mon Jun 18 18:48:41 PDT 2007



Changes in directory llvm/lib/CodeGen:

LiveIntervalAnalysis.cpp updated: 1.247 -> 1.248
VirtRegMap.cpp updated: 1.112 -> 1.113
---
Log message:

Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoad
with a general target hook to identify rematerializable instructions. Some
instructions are only rematerializable with specific operands, such as loads
from constant pools, while others are always rematerializable. This hook
allows both to be identified as being rematerializable with the same
mechanism.


---
Diffs of the changes:  (+6 -8)

 LiveIntervalAnalysis.cpp |    9 ++++-----
 VirtRegMap.cpp           |    5 ++---
 2 files changed, 6 insertions(+), 8 deletions(-)


Index: llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff -u llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.247 llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.248
--- llvm/lib/CodeGen/LiveIntervalAnalysis.cpp:1.247	Thu Jun 14 15:50:44 2007
+++ llvm/lib/CodeGen/LiveIntervalAnalysis.cpp	Mon Jun 18 20:48:04 2007
@@ -336,14 +336,13 @@
   // 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. The target may permit other loads to
-    // be re-materialized as well.
+    // stack slots are re-materializable. The target may permit other
+    // instructions to be re-materialized as well.
     int FrameIdx = 0;
     if (vi.DefInst &&
-        (tii_->isReMaterializable(vi.DefInst->getOpcode()) ||
+        (tii_->isTriviallyReMaterializable(vi.DefInst) ||
          (tii_->isLoadFromStackSlot(vi.DefInst, FrameIdx) &&
-          mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx)) ||
-         tii_->isOtherReMaterializableLoad(vi.DefInst)))
+          mf_->getFrameInfo()->isFixedObjectIndex(FrameIdx))))
       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.112 llvm/lib/CodeGen/VirtRegMap.cpp:1.113
--- llvm/lib/CodeGen/VirtRegMap.cpp:1.112	Thu Jun 14 15:50:44 2007
+++ llvm/lib/CodeGen/VirtRegMap.cpp	Mon Jun 18 20:48:04 2007
@@ -663,9 +663,8 @@
 
     // If this instruction is being rematerialized, just remove it!
     int FrameIdx;
-    if ((TID->Flags & M_REMATERIALIZIBLE) ||
-        TII->isLoadFromStackSlot(&MI, FrameIdx) ||
-        TII->isOtherReMaterializableLoad(&MI)) {
+    if (TII->isTriviallyReMaterializable(&MI) ||
+        TII->isLoadFromStackSlot(&MI, FrameIdx)) {
       bool Remove = true;
       for (unsigned i = 0, e = MI.getNumOperands(); i != e; ++i) {
         MachineOperand &MO = MI.getOperand(i);






More information about the llvm-commits mailing list