[PATCH] D31681: [ExecutionDepsFix] Don't recurse over the CFG

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 15:26:12 PDT 2017


mehdi_amini accepted this revision.
mehdi_amini added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/CodeGen/ExecutionDepsFix.cpp:710
   ReversePostOrderTraversal<MachineBasicBlock*> RPOT(Entry);
+  std::vector<MachineBasicBlock *> ToRevisit;
   for (ReversePostOrderTraversal<MachineBasicBlock*>::rpo_iterator
----------------
SmallVector?
`Worklist` or `Workqueue` seems a more common name for iterative algorithm I think.


================
Comment at: lib/CodeGen/ExecutionDepsFix.cpp:719
     processBasicBlock(MBB, true);
-    updateSuccessors(MBB, true);
+    updateSuccessors(ToRevisit, MBB, true);
+    while (!ToRevisit.empty()) {
----------------
Seed the workqueue instead to remove this call.


================
Comment at: lib/CodeGen/ExecutionDepsFix.cpp:724
+      processBasicBlock(ToRevisitBB, false);
+      updateSuccessors(ToRevisit, ToRevisitBB, false);
+    }
----------------
Is it the only use of updateSuccessors? Could be inlined if so, the code seems simple enough.


https://reviews.llvm.org/D31681





More information about the llvm-commits mailing list