summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2015-11-23 19:16:15 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2015-11-23 19:16:15 +0000
commitd0430e85808b2ef6f71d0383b201d608b0d1955a (patch)
treeff21895c1aad8e5a1efd0813d7172603f42f7130 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentf6857223c9fd534825cd8307b9cb37ada230ec83 (diff)
downloadbcm5719-llvm-d0430e85808b2ef6f71d0383b201d608b0d1955a.tar.gz
bcm5719-llvm-d0430e85808b2ef6f71d0383b201d608b0d1955a.zip
[WinEH] Fix problem where CodeGenPrepare incorrectly sinks a bitcast into an EH pad.
Differential Revision: http://reviews.llvm.org/D14842 llvm-svn: 253902
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index ce6308dd709..d619044e86c 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -730,6 +730,12 @@ static bool SinkCast(CastInst *CI) {
// Preincrement use iterator so we don't invalidate it.
++UI;
+ // If the block selected to receive the cast is an EH pad that does not
+ // allow non-PHI instructions before the terminator, we can't sink the
+ // cast.
+ if (UserBB->getTerminator()->isEHPad())
+ continue;
+
// If this user is in the same block as the cast, don't change the cast.
if (UserBB == DefBB) continue;
OpenPOWER on IntegriCloud