summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopUnswitch.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
commit1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8 (patch)
tree719834c43dbeab5fa7413c1e2a259167fc6307b0 /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
parent51f57a419581f772fb06e4c27128e702373177d9 (diff)
downloadbcm5719-llvm-1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8.tar.gz
bcm5719-llvm-1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8.zip
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. llvm-svn: 71071
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index 2afb3c8ed7a..e3e881f0812 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -300,7 +300,7 @@ static bool isTrivialLoopExitBlockHelper(Loop *L, BasicBlock *BB,
// Okay, everything after this looks good, check to make sure that this block
// doesn't include any side effects.
for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I)
- if (I->mayWriteToMemory())
+ if (I->mayHaveSideEffects())
return false;
return true;
@@ -383,7 +383,7 @@ bool LoopUnswitch::IsTrivialUnswitchCondition(Value *Cond, Constant **Val,
// part of the loop that the code *would* execute. We already checked the
// tail, check the header now.
for (BasicBlock::iterator I = Header->begin(), E = Header->end(); I != E; ++I)
- if (I->mayWriteToMemory())
+ if (I->mayHaveSideEffects())
return false;
return true;
}
OpenPOWER on IntegriCloud