[PATCH] D36704: [CodeGen] Minimize the dependency graph of fused instructions

Evandro Menezes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 11:52:25 PDT 2017


evandro created this revision.
Herald added a subscriber: hiraditya.

Only data dependencies are important to fused instructions, so only make those dependent on one to also depend on the other when it's not merely a control dependency.


Repository:
  rL LLVM

https://reviews.llvm.org/D36704

Files:
  llvm/lib/CodeGen/MacroFusion.cpp


Index: llvm/lib/CodeGen/MacroFusion.cpp
===================================================================
--- llvm/lib/CodeGen/MacroFusion.cpp
+++ llvm/lib/CodeGen/MacroFusion.cpp
@@ -58,10 +58,10 @@
                   DAG.TII->getName(SecondSU.getInstr()->getOpcode()) << '\n'; );
 
   if (&SecondSU != &DAG.ExitSU)
-    // Make instructions dependent on FirstSU also dependent on SecondSU to
+    // Make data dependencies from FirstSU also dependent on SecondSU to
     // prevent them from being scheduled between FirstSU and and SecondSU.
     for (const SDep &SI : FirstSU.Succs) {
-      if (SI.getSUnit() == &SecondSU)
+      if (SI.isCtrl() || SI.getSUnit() == &SecondSU)
         continue;
       DEBUG(dbgs() << "  Copy Succ ";
             SI.getSUnit()->print(dbgs(), &DAG); dbgs() << '\n';);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36704.111041.patch
Type: text/x-patch
Size: 808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170814/2e5945f0/attachment.bin>


More information about the llvm-commits mailing list