[PATCH] D40699: Split IndirectBr critical edges before PGO gen/use passes.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 8 09:30:14 PST 2017


davidxl added inline comments.


================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:544
+            !E->InMST && E->IsCritical && E->DestBB)
+          IndirectBrTargets.insert(const_cast<BasicBlock *>(E->DestBB));
+      }
----------------
It seems cleaner to move the IndirectBrTargets collection inside MST's buildEdges method.


================
Comment at: lib/Transforms/Instrumentation/PGOInstrumentation.cpp:548
+        SplitIndirectBrCriticalEdges(F, &IndirectBrTargets, BPI, BFI);
+        MST = CFGMST<Edge, BBInfo>(&F, BPI, BFI);
+      }
----------------
There seems no guarantee that the non-split indirectBR critical edges will be be in MST when cfgmst is recomputed. 


https://reviews.llvm.org/D40699





More information about the llvm-commits mailing list