[SCCP] If we replace with a constant, we can't replace with a range.
authorDavide Italiano <davide@freebsd.org>
Tue, 21 Nov 2017 00:21:52 +0000 (00:21 +0000)
committerDavide Italiano <davide@freebsd.org>
Tue, 21 Nov 2017 00:21:52 +0000 (00:21 +0000)
This microoptimization is NFC.

llvm-svn: 318711

llvm/lib/Transforms/Scalar/SCCP.cpp

index 1e4bf2e..192ba13 100644 (file)
@@ -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;