[llvm] r318711 - [SCCP] If we replace with a constant, we can't replace with a range.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 20 16:21:52 PST 2017


Author: davide
Date: Mon Nov 20 16:21:52 2017
New Revision: 318711

URL: http://llvm.org/viewvc/llvm-project?rev=318711&view=rev
Log:
[SCCP] If we replace with a constant, we can't replace with a range.

This microoptimization is NFC.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SCCP.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=318711&r1=318710&r2=318711&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Mon Nov 20 16:21:52 2017
@@ -1866,8 +1866,10 @@ static bool runIPSCCP(Module &M, const D
     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;




More information about the llvm-commits mailing list