aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LoopDeletion.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-05-06 06:49:50 +0000
committerDuncan Sands <baldrick@free.fr>2009-05-06 06:49:50 +0000
commit2f50083a5a30363d5e6e7ae34f7b0615d419860d (patch)
tree36e5d75294f6632cb5486c95675e0f2b6d13de86 /lib/Transforms/Scalar/LoopDeletion.cpp
parent905a30bc1c09d1501716dc3d12053a93fabaaefe (diff)
downloadexternal_llvm-2f50083a5a30363d5e6e7ae34f7b0615d419860d.zip
external_llvm-2f50083a5a30363d5e6e7ae34f7b0615d419860d.tar.gz
external_llvm-2f50083a5a30363d5e6e7ae34f7b0615d419860d.tar.bz2
Allow readonly functions to unwind exceptions. Teach
the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopDeletion.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp
index 96b7a52..6512672 100644
--- a/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -136,11 +136,8 @@ bool LoopDeletion::IsLoopDead(Loop* L,
LI != LE; ++LI) {
for (BasicBlock::iterator BI = (*LI)->begin(), BE = (*LI)->end();
BI != BE; ++BI) {
- if (BI->mayWriteToMemory())
+ if (BI->mayHaveSideEffects())
return false;
- else if (LoadInst* L = dyn_cast<LoadInst>(BI))
- if (L->isVolatile())
- return false;
}
}