[PATCH] D18226: Codegen: Tail-duplicate during placement.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 18:25:22 PDT 2016


iteratee marked an inline comment as done.

================
Comment at: lib/CodeGen/BranchFolding.cpp:633
@@ -622,3 +632,3 @@
     unsigned NumTerms = CountTerminators(MBB1 == PredBB ? MBB2 : MBB1, I);
     if (CommonTailLen > NumTerms)
       return true;
----------------
I changed this heuristic to avoid undoing valuable duplication. In fact, some of the cases where it doesn't merge are cases where we wanted to tail duplicate, but couldn't. See Hexagon/rdf-copy.ll

I'll split the changes here out into a separate patch.

================
Comment at: lib/CodeGen/BranchFolding.cpp:656
@@ +655,3 @@
+  // duplicated.
+  if (!AfterPlacement)
+    if (SuccBB && MBB1 != PredBB && MBB2 != PredBB &&
----------------
Discussed this with chandlerc. He thinks that passing around the list of blocks that were tail-duplicated too tightly couples the passes, and that we should strive to have non-overlap. He suggested that a list of blocks that were duplicated might be a good debug measure to make sure they aren't being re-merged.

Overall I agree with him, and I made a change so there shouldn't be any overlap.
Do you want to see the set as a debugging measure?


http://reviews.llvm.org/D18226





More information about the llvm-commits mailing list