[llvm-commits] [llvm] r117506 - /llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp

Evan Cheng evan.cheng at apple.com
Wed Oct 27 16:17:17 PDT 2010


Author: evancheng
Date: Wed Oct 27 18:17:17 2010
New Revision: 117506

URL: http://llvm.org/viewvc/llvm-project?rev=117506&view=rev
Log:
Putting r117193 back except for the compile time cost. Rather than assuming fallthroughs uses all registers, just gather the union of all successor liveins.

Modified:
    llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp

Modified: llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp?rev=117506&r1=117505&r2=117506&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScheduleDAGInstrs.cpp Wed Oct 27 18:17:17 2010
@@ -168,9 +168,16 @@
     }
   } else {
     // For others, e.g. fallthrough, conditional branch, assume the exit
-    // uses all the registers.
-    // FIXME: This causes too much compile time regression. We need to compute
-    // liveout instead.
+    // uses all the registers that are livein to the successor blocks.
+    SmallSet<unsigned, 8> Seen;
+    for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
+           SE = BB->succ_end(); SI != SE; ++SI)
+      for (MachineBasicBlock::livein_iterator I = (*SI)->livein_begin(),
+             E = (*SI)->livein_end(); I != E; ++I) {    
+        unsigned Reg = *I;
+        if (Seen.insert(Reg))
+          Uses[Reg].push_back(&ExitSU);
+      }
   }
 }
 





More information about the llvm-commits mailing list