summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorErik Verbruggen <erikjv@me.com>2014-03-11 15:07:32 +0000
committerErik Verbruggen <erikjv@me.com>2014-03-11 15:07:32 +0000
commit3f5dcc97e020a480e9252bbd120843c3777b1ffb (patch)
treeaa22df19cc2293c278812079900a3e3c7f90a83c /llvm/lib/Transforms/Scalar
parent3db2acb71a673c9caab1ddbf18d45242e6eb6598 (diff)
downloadbcm5719-llvm-3f5dcc97e020a480e9252bbd120843c3777b1ffb.tar.gz
bcm5719-llvm-3f5dcc97e020a480e9252bbd120843c3777b1ffb.zip
Fix crash in PRE.
After r203553 overflow intrinsics and their non-intrinsic (normal) instruction get hashed to the same value. This patch prevents PRE from moving an instruction into a predecessor block, and trying to add a phi node that gets two different types (the intrinsic result and the non-intrinsic result), resulting in a failing assert. llvm-svn: 203574
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-rw-r--r--llvm/lib/Transforms/Scalar/GVN.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index c4a9a5a61ee..53c120530f7 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -2550,6 +2550,8 @@ bool GVN::performPRE(Function &F) {
predMap.push_back(std::make_pair(static_cast<Value *>(0), P));
PREPred = P;
++NumWithout;
+ } else if (predV->getType() != CurInst->getType()) {
+ continue;
} else if (predV == CurInst) {
/* CurInst dominates this predecessor. */
NumWithout = 2;
OpenPOWER on IntegriCloud