aboutsummaryrefslogtreecommitdiff
path: root/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
commit7af1c78b98d2df7d0ab9154461ca3d835706716e (patch)
tree36e5d75294f6632cb5486c95675e0f2b6d13de86 /lib/Transforms/Scalar/LoopUnswitch.cpp
parente031e4bcb91ceafa2ddf0a7480a7135bdf5ebd57 (diff)
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/LoopUnswitch.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 2afb3c8ed7..e3e881f081 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/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;
}