[llvm] r305583 - [SCCP] Simplify the code a bit. NFCI.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 16 13:50:31 PDT 2017
Author: davide
Date: Fri Jun 16 15:50:31 2017
New Revision: 305583
URL: http://llvm.org/viewvc/llvm-project?rev=305583&view=rev
Log:
[SCCP] Simplify the code a bit. NFCI.
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=305583&r1=305582&r2=305583&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Fri Jun 16 15:50:31 2017
@@ -1815,15 +1815,11 @@ static bool runIPSCCP(Module &M, const D
if (F.isDeclaration())
continue;
- if (Solver.isBlockExecutable(&F.front())) {
+ if (Solver.isBlockExecutable(&F.front()))
for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E;
- ++AI) {
- if (AI->use_empty())
- continue;
- if (tryToReplaceWithConstant(Solver, &*AI))
+ ++AI)
+ if (!AI->use_empty() && tryToReplaceWithConstant(Solver, &*AI))
++IPNumArgsElimed;
- }
- }
for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
if (!Solver.isBlockExecutable(&*BB)) {
More information about the llvm-commits
mailing list