SCCP also needs to be taught to follow unwind_to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48109 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index b1c923c..6493f0e 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -1082,6 +1082,10 @@
}
}
Instruction *I = CS.getInstruction();
+
+ if (!CS.doesNotThrow() && I->getParent()->getUnwindDest())
+ markEdgeExecutable(I->getParent(), I->getParent()->getUnwindDest());
+
if (I->getType() == Type::VoidTy) return;
LatticeVal &IV = ValueState[I];