From: Davide Italiano Date: Tue, 21 Nov 2017 00:21:52 +0000 (+0000) Subject: [SCCP] If we replace with a constant, we can't replace with a range. X-Git-Tag: llvmorg-6.0.0-rc1~2957 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5df8080011a71042a1684317f8f297516e6f4458;p=platform%2Fupstream%2Fllvm.git [SCCP] If we replace with a constant, we can't replace with a range. This microoptimization is NFC. llvm-svn: 318711 --- diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp index 1e4bf2e..192ba13 100644 --- a/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/llvm/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;