[PATCH] D32400: [JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 23 13:18:36 PDT 2017


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

lgtm with minor nit



================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:1298
+        (size_t)std::distance(pred_begin(BB), pred_end(BB))) {
+      auto *TheOnlyDest = OnlyDest;
+      for (BasicBlock *SuccBB : successors(BB)) {
----------------
The `TheOnlyDest` variable name threw me off a bit.  How about being 100% explicit, and using a `bool SeenFirstBranchToOnlyDest;`?


https://reviews.llvm.org/D32400





More information about the llvm-commits mailing list