[PATCH] D29620: [JumpThreading] Thread through guards

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 08:31:36 PST 2017


mkazantsev added inline comments.


================
Comment at: llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp:2076
+    if (Parent == Pred2->getSinglePredecessor())
+      if (BranchInst *BI = dyn_cast<BranchInst>(Parent->getTerminator()))
+        for (auto &I : *BB)
----------------
anna wrote:
> Hi Max, I think you need to check that branch is a conditional branch. Otherwise we can fail while trying to get the condition for the branch in `ThreadGuard` at line 2091.
You're right, I need to add this check here.


Repository:
  rL LLVM

https://reviews.llvm.org/D29620





More information about the llvm-commits mailing list