[PATCH] D49408: [SCCP] Don't use markForcedConstant on branch conditions.
Davide Italiano via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 18 18:29:59 PDT 2018
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.
LGTM modulo minor. Thanks.
================
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)) {
----------------
do you need the `else` here? IIRC they are all mutually exclusive.
Repository:
rL LLVM
https://reviews.llvm.org/D49408
More information about the llvm-commits
mailing list