[PATCH] D35584: [CGP] Fold empty dedicated exit blocks created by loopsimplify.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 12:16:15 PDT 2017


efriedma added a comment.

It's hard to predict what exactly PHIElimination will do at this point in the pipeline... I don't have any better suggestions for a heuristic here.

(GlobalISel is irrelevant, I think; we keep around PHI nodes until register allocation.)



================
Comment at: lib/CodeGen/CodeGenPrepare.cpp:657
+    L->getExitBlocks(ExitBlocks);
+    while(!ExitBlocks.empty())
+      ExitBBSet.insert(ExitBlocks.pop_back_val());
----------------
Whitespace.


================
Comment at: test/Transforms/CodeGenPrepare/merge-empty-latch-block.ll:49
+; CHECK: %c.140 = phi i32 [ %call2, %if.end ], [ %call20, %if.else19 ], [ -1, %if.then18 ], [ %call15, %if.then14 ], [ %c.2, %while.cond5 ]
+; CHECK-NOT: %c.140 = phi i32 [ %call2, %if.end ], [ %call20, %if.else19 ], [ -1, %if.then18 ], [ %call15, %if.then14 ], [ %c.2, %while.body.backedge.loopexit ]
+while.body:                                       ; preds = %while.body.backedge, %if.end
----------------
Needs a comment explaining why you're looking for this pattern.


https://reviews.llvm.org/D35584





More information about the llvm-commits mailing list