[PATCH] D28522: Codegen: Make chains from lattice-shaped CFGs

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 13:48:37 PST 2017


davidxl added inline comments.


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1296
 
+  // if BB is part of a lattice, Use the lattice to determine the optimal
+  // fallthrough edges
----------------
iteratee wrote:
> davidxl wrote:
> > Extract the special handling of lattice code into a helper to make the main flow of the caller cleaner.
> It already is in 2 helpers. Ignoring the logging the logic is:
> if (isLattice)
>   return getBestLattice();
> 
> I don't see how a helper would be useful in this case.
I suggest pushing isLattice check into getBestLatticeSuccessor call.  Also pushing the debug tracking code there too. The caller will be like

if (LatticeSucc = getBestLatticeSuccessor(...)) {
   return BlockAndTailDupResult(LatticeSucc, false}'
 }




================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1292
+    DEBUG(dbgs() << "Lattice, but not one of the chosen edges.\n");
+    return BestSucc;
+  }
----------------
Is this null? can you explain this code?


https://reviews.llvm.org/D28522





More information about the llvm-commits mailing list