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
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp
index ffa1d90..40d2e4a 100644
--- a/lib/Transforms/Scalar/LoopIndexSplit.cpp
+++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp
@@ -1148,7 +1148,7 @@
|| isa<DbgInfoIntrinsic>(I))
continue;
- if (I->mayWriteToMemory())
+ if (I->mayHaveSideEffects())
return false;
// I is used only inside this block then it is OK.