diff options
author | Duncan Sands <baldrick@free.fr> | 2009-05-06 06:49:50 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2009-05-06 06:49:50 +0000 |
commit | 7af1c78b98d2df7d0ab9154461ca3d835706716e (patch) | |
tree | 36e5d75294f6632cb5486c95675e0f2b6d13de86 /lib/Transforms/Scalar/TailDuplication.cpp | |
parent | e031e4bcb91ceafa2ddf0a7480a7135bdf5ebd57 (diff) | |
download | external_llvm-7af1c78b98d2df7d0ab9154461ca3d835706716e.zip external_llvm-7af1c78b98d2df7d0ab9154461ca3d835706716e.tar.gz external_llvm-7af1c78b98d2df7d0ab9154461ca3d835706716e.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/TailDuplication.cpp')
-rw-r--r-- | lib/Transforms/Scalar/TailDuplication.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/TailDuplication.cpp b/lib/Transforms/Scalar/TailDuplication.cpp index 7869069..99a7dee 100644 --- a/lib/Transforms/Scalar/TailDuplication.cpp +++ b/lib/Transforms/Scalar/TailDuplication.cpp @@ -258,7 +258,7 @@ void TailDup::eliminateUnconditionalBranch(BranchInst *Branch) { while (!isa<TerminatorInst>(BBI)) { Instruction *I = BBI++; - bool CanHoist = !I->isTrapping() && !I->mayWriteToMemory(); + bool CanHoist = !I->isTrapping() && !I->mayHaveSideEffects(); if (CanHoist) { for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op) if (Instruction *OpI = dyn_cast<Instruction>(I->getOperand(op))) |