[PATCH] D29620: [JumpThreading] Thread through guards

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 9 18:36:25 PST 2017


reames added a comment.

Nice!  Two ideas for future enhancements:

1. This should really handle more than two predecessors where the condition is known along some subset of them.  Preferably by using the full power of LVI.
2. The organization of this transform would also be applicable to select instructions.  Generalizing it to replace the dedicated select logic in this pass would be good.  Less code, more testing.



================
Comment at: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp:2074
+  // TODO: Look up deeper than to immediate predecessor?
+  if (auto Parent = Pred1->getSinglePredecessor())
+    if (Parent == Pred2->getSinglePredecessor())
----------------
minor: using an early return here would be easier to follow


Repository:
  rL LLVM

https://reviews.llvm.org/D29620





More information about the llvm-commits mailing list