aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-11-02 03:25:55 +0000
committerChris Lattner <sabre@nondot.org>2009-11-02 03:25:55 +0000
commit89112b608f50e2944619b320bd04d31bbd57b370 (patch)
tree6fd6451c59708da94c4fab65a03225a3a0b54fc9
parent36c9952b1b218f99697910fc81588a29f600e6aa (diff)
downloadexternal_llvm-89112b608f50e2944619b320bd04d31bbd57b370.tar.gz
external_llvm-89112b608f50e2944619b320bd04d31bbd57b370.tar.bz2
external_llvm-89112b608f50e2944619b320bd04d31bbd57b370.zip
only IPSCCP incoming arguments if the function is executable, this fixes
an assertion on the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85784 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index 016d018d73..5e360d96a5 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1713,21 +1713,23 @@ bool IPSCCP::runOnModule(Module &M) {
SmallVector<BasicBlock*, 512> BlocksToErase;
for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
- for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
- AI != E; ++AI) {
- if (AI->use_empty()) continue;
-
- LatticeVal IV = Solver.getLatticeValueFor(AI);
- if (IV.isOverdefined()) continue;
-
- Constant *CST = IV.isConstant() ?
- IV.getConstant() : UndefValue::get(AI->getType());
- DEBUG(errs() << "*** Arg " << *AI << " = " << *CST <<"\n");
-
- // Replaces all of the uses of a variable with uses of the
- // constant.
- AI->replaceAllUsesWith(CST);
- ++IPNumArgsElimed;
+ if (Solver.isBlockExecutable(F->begin())) {
+ for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
+ AI != E; ++AI) {
+ if (AI->use_empty()) continue;
+
+ LatticeVal IV = Solver.getLatticeValueFor(AI);
+ if (IV.isOverdefined()) continue;
+
+ Constant *CST = IV.isConstant() ?
+ IV.getConstant() : UndefValue::get(AI->getType());
+ DEBUG(errs() << "*** Arg " << *AI << " = " << *CST <<"\n");
+
+ // Replaces all of the uses of a variable with uses of the
+ // constant.
+ AI->replaceAllUsesWith(CST);
+ ++IPNumArgsElimed;
+ }
}
for (Function::iterator BB = F->begin(), E = F->end(); BB != E; ++BB) {