[PATCH] D49408: [SCCP] Don't use markForcedConstant on branch conditions.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 18:37:38 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/SCCP.cpp:1965-1975
+          if (SwitchInst *SI = dyn_cast<SwitchInst>(I)) {
+            Dest = SI->case_begin()->getCaseSuccessor();
+            C = SI->case_begin()->getCaseValue();
+          } else if (BranchInst *BI = dyn_cast<BranchInst>(I)) {
+            Dest = BI->getSuccessor(1);
+            C = ConstantInt::getFalse(BI->getContext());
+          } else if (IndirectBrInst *IBR = dyn_cast<IndirectBrInst>(I)) {
----------------
davide wrote:
> do you need the `else` here? IIRC they are all mutually exclusive.
Just trying to make clear that this isn't an exhaustive list of possible terminator instructions (there are also exception-handling instructions, but we always treat their successors as feasible).


Repository:
  rL LLVM

https://reviews.llvm.org/D49408





More information about the llvm-commits mailing list