[llvm-commits] [llvm] r59785 - in /llvm/trunk: include/llvm/CodeGen/ScheduleDAG.h lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Dan Gohman gohman at apple.com
Thu Nov 20 18:27:52 PST 2008


Author: djg
Date: Thu Nov 20 20:27:52 2008
New Revision: 59785

URL: http://llvm.org/viewvc/llvm-project?rev=59785&view=rev
Log:
Add a flag to SDep for tracking which edges are anti-dependence edges.

Modified:
    llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
    llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp

Modified: llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h?rev=59785&r1=59784&r2=59785&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScheduleDAG.h Thu Nov 20 20:27:52 2008
@@ -48,8 +48,10 @@
     bool      isArtificial : 1; // True iff it's an artificial ctrl dep added
                                 // during sched that may be safely deleted if
                                 // necessary.
-    SDep(SUnit *d, unsigned r, int t, bool c, bool a)
-      : Dep(d), Reg(r), Cost(t), isCtrl(c), isArtificial(a) {}
+    bool      isAntiDep : 1; // True iff it's an anti-dependency (on a physical
+                             // register.
+    SDep(SUnit *d, unsigned r, int t, bool c, bool a, bool anti)
+      : Dep(d), Reg(r), Cost(t), isCtrl(c), isArtificial(a), isAntiDep(anti) {}
   };
 
   /// SUnit - Scheduling unit. This is a node in the scheduling DAG.
@@ -140,15 +142,17 @@
     }
 
     /// addPred - This adds the specified node as a pred of the current node if
-    /// not already.  This returns true if this is a new pred.
+    /// not already.  It also adds the current node as a successor of the
+    /// specified node.  This returns true if this is a new pred.
     bool addPred(SUnit *N, bool isCtrl, bool isArtificial,
-                 unsigned PhyReg = 0, int Cost = 1) {
+                 unsigned PhyReg = 0, int Cost = 1, bool isAntiDep = false) {
       for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
         if (Preds[i].Dep == N &&
             Preds[i].isCtrl == isCtrl && Preds[i].isArtificial == isArtificial)
           return false;
-      Preds.push_back(SDep(N, PhyReg, Cost, isCtrl, isArtificial));
-      N->Succs.push_back(SDep(this, PhyReg, Cost, isCtrl, isArtificial));
+      Preds.push_back(SDep(N, PhyReg, Cost, isCtrl, isArtificial, isAntiDep));
+      N->Succs.push_back(SDep(this, PhyReg, Cost, isCtrl,
+                              isArtificial, isAntiDep));
       if (!isCtrl) {
         ++NumPreds;
         ++N->NumSuccs;

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp?rev=59785&r1=59784&r2=59785&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp Thu Nov 20 20:27:52 2008
@@ -287,18 +287,18 @@
       if (I->isCtrl)
         ChainPred = I->Dep;
       else if (I->Dep->getNode() && I->Dep->getNode()->isOperandOf(LoadNode))
-        LoadPreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false));
+        LoadPreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false, false));
       else
-        NodePreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false));
+        NodePreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false, false));
     }
     for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
          I != E; ++I) {
       if (I->isCtrl)
         ChainSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
-                                  I->isCtrl, I->isArtificial));
+                                  I->isCtrl, I->isArtificial, I->isAntiDep));
       else
         NodeSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
-                                 I->isCtrl, I->isArtificial));
+                                 I->isCtrl, I->isArtificial, I->isAntiDep));
     }
 
     if (ChainPred) {

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp?rev=59785&r1=59784&r2=59785&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Thu Nov 20 20:27:52 2008
@@ -688,18 +688,18 @@
       if (I->isCtrl)
         ChainPred = I->Dep;
       else if (I->Dep->getNode() && I->Dep->getNode()->isOperandOf(LoadNode))
-        LoadPreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false));
+        LoadPreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false, false));
       else
-        NodePreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false));
+        NodePreds.push_back(SDep(I->Dep, I->Reg, I->Cost, false, false, false));
     }
     for (SUnit::succ_iterator I = SU->Succs.begin(), E = SU->Succs.end();
          I != E; ++I) {
       if (I->isCtrl)
         ChainSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
-                                  I->isCtrl, I->isArtificial));
+                                  I->isCtrl, I->isArtificial, I->isAntiDep));
       else
         NodeSuccs.push_back(SDep(I->Dep, I->Reg, I->Cost,
-                                 I->isCtrl, I->isArtificial));
+                                 I->isCtrl, I->isArtificial, I->isAntiDep));
     }
 
     if (ChainPred) {





More information about the llvm-commits mailing list