From 1efabaaa2ad2a90bb2fe7f79461353b5f1ea63e8 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 6 May 2009 06:49:50 +0000 Subject: 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 --- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp') diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp index e1234ef..682d069 100644 --- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp +++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp @@ -201,7 +201,7 @@ bool TailCallElim::runOnFunction(Function &F) { bool TailCallElim::CanMoveAboveCall(Instruction *I, CallInst *CI) { // FIXME: We can move load/store/call/free instructions above the call if the // call does not mod/ref the memory location being processed. - if (I->mayWriteToMemory() || isa(I)) + if (I->mayHaveSideEffects() || isa(I)) return false; // Otherwise, if this is a side-effect free instruction, check to make sure -- cgit v1.1