summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-06-16 20:50:31 +0000
committerDavide Italiano <davide@freebsd.org>2017-06-16 20:50:31 +0000
commitec5b0257bfcc5c87710e92bf58d2a334091b058f (patch)
treeebccc884956a7b435f93e33ced1e5cf27bc19599 /llvm/lib/Transforms
parent79ac99b3e8df4c9fd4812ab119b55b50f5f762ce (diff)
downloadbcm5719-llvm-ec5b0257bfcc5c87710e92bf58d2a334091b058f.tar.gz
bcm5719-llvm-ec5b0257bfcc5c87710e92bf58d2a334091b058f.zip
[SCCP] Simplify the code a bit. NFCI.
llvm-svn: 305583
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SCCP.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index 79cb0c85efe..7a6fa171141 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -1815,15 +1815,11 @@ static bool runIPSCCP(Module &M, const DataLayout &DL,
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)) {
OpenPOWER on IntegriCloud