From 5df8080011a71042a1684317f8f297516e6f4458 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Tue, 21 Nov 2017 00:21:52 +0000 Subject: [PATCH] [SCCP] If we replace with a constant, we can't replace with a range. This microoptimization is NFC. llvm-svn: 318711 --- llvm/lib/Transforms/Scalar/SCCP.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.7.4