summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/SCCP.cpp
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-11-21 00:21:52 +0000
committerDavide Italiano <davide@freebsd.org>2017-11-21 00:21:52 +0000
commit3a95a12ddda7638aa354aa314e50bff38db2e301 (patch)
treeffa998400648e239b6f4e48ea394c28133e67e99 /lib/Transforms/Scalar/SCCP.cpp
parent5121f3c7c1d3c43c2bd9a46fac80cc094fa19c4f (diff)
[SCCP] If we replace with a constant, we can't replace with a range.
This microoptimization is NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318711 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 1e4bf2e889d..192ba13c598 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1866,8 +1866,10 @@ static bool runIPSCCP(Module &M, const DataLayout &DL,
if (Solver.isBlockExecutable(&F.front()))
for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E;
++AI) {
- if (!AI->use_empty() && tryToReplaceWithConstant(Solver, &*AI))
+ if (!AI->use_empty() && tryToReplaceWithConstant(Solver, &*AI)) {
++IPNumArgsElimed;
+ continue;
+ }
if (!AI->use_empty() && tryToReplaceWithConstantRange(Solver, &*AI))
++IPNumRangeInfoUsed;