[PATCH] D33847: [PartialInlining] Enhance code outliner to sink locals declared outside the outline region

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 12:12:48 PDT 2017


davide added inline comments.


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:147-162
+  if (any_of(Blocks, [&](BasicBlock *Block) {
+        if (any_of(successors(Block), [&](BasicBlock *Succ) {
+              // Internal edges, ok.
+              if (Blocks.count(Succ))
+                return false;
+              if (!CommonExitBlock) {
+                CommonExitBlock = Succ;
----------------
I think this is a case where two nested lambda expressions make the code hard to understand. I'd convert them to a for loop.


================
Comment at: lib/Transforms/Utils/CodeExtractor.cpp:259
+  // be created before code extraction.
+  assert(!getFirstPHI(CommonExitBlock) && "Phi not expected");
+
----------------
You can probably move this inside the `NDEBUG` block.


https://reviews.llvm.org/D33847





More information about the llvm-commits mailing list