[PATCH] D20505: Codegen: Outline for chains of tail-duplicable blocks.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 14:59:11 PDT 2016


iteratee added inline comments.

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:825-826
@@ +824,4 @@
+        }
+        bool TailBlockRemoved = false;
+        auto RemovalCallback =
+            [&](MachineBasicBlock *RemBB) {
----------------
echristo wrote:
> Can you document everything that's going on here more please? In particular, what's going on with the callback here and why it needs to be a callback rather than happening on the spot.
I've added a comment to this effect, but the reason it has to be a callback is because none of the things that occur would be valid after deleting the block. (use after free).

As to the rest, the function is broken up into small chunks with a comment as to what each chunk is doing. Is there something more you'd like to see?

================
Comment at: lib/CodeGen/MachineBlockPlacement.cpp:1288
@@ +1287,3 @@
+
+/// \brief Finds unavoidable blocks within a loop.
+///
----------------
echristo wrote:
> Once again I can't remember if we have autobrief turned on or not...
Even if we do, it's probably better to match the existing style for this change, and clean it up in a separate patch.


http://reviews.llvm.org/D20505





More information about the llvm-commits mailing list