[PATCH] D34271: [MBP] do not rotate loop if it creates extra branch

Kyle Butt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 11:26:46 PDT 2017


iteratee added inline comments.


================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1952
+  // extra one only if the last block in a chain is a predecessor of first
+  // element in chain, because then rotation will eliminate one branch.
+  if (ViableTopFallthrough) {
----------------
Can you re-write this comment, I can't make heads or tails of what you're trying to do.

Something like:
Rotating a loop exit to the bottom when there is a fallthrough to top trades the entry fallthrough for an exit fallthrough.
If there is no bottom->top edge, but the chosen exit block does have a fallthrough, We break that fallthrough for nothing in return.

You don't have to use that language, but embedding your example may help as well. Include the Pre and Post blocks in the sequences, it makes it more obvious what's going on, and don't assume that the the header is the chosen exit block.



https://reviews.llvm.org/D34271





More information about the llvm-commits mailing list