diff options
Diffstat (limited to 'lib/Transforms/Scalar/ADCE.cpp')
-rw-r--r-- | lib/Transforms/Scalar/ADCE.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/ADCE.cpp b/lib/Transforms/Scalar/ADCE.cpp index e3bd362..7f37334 100644 --- a/lib/Transforms/Scalar/ADCE.cpp +++ b/lib/Transforms/Scalar/ADCE.cpp @@ -198,8 +198,7 @@ bool ADCE::doADCE() { for (BasicBlock::iterator II = BB->begin(), EI = BB->end(); II != EI; ) { Instruction *I = II++; if (CallInst *CI = dyn_cast<CallInst>(I)) { - Function *F = CI->getCalledFunction(); - if (F && AA.onlyReadsMemory(F)) { + if (AA.onlyReadsMemory(CI)) { if (CI->use_empty()) { BB->getInstList().erase(CI); ++NumCallRemoved; |