summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-09-05 18:16:19 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-09-05 18:16:19 +0000
commitae707bd5594e52a8b385760f99ff58aa8fede948 (patch)
tree3726515bd8ffa642caf5d49316cef37570f1c7ae /lib/Analysis
parentad99ef8bf59adf151ac217e3b2ae6abec41f76e6 (diff)
downloadllvm-ae707bd5594e52a8b385760f99ff58aa8fede948.tar.gz
llvm-ae707bd5594e52a8b385760f99ff58aa8fede948.tar.bz2
llvm-ae707bd5594e52a8b385760f99ff58aa8fede948.tar.xz
InstSimplify: Don't try to replace an extractvalue/insertvalue pair with the original value if types don't match.
Fixes clang selfhost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index deb7fed18b..131cc97d23 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -2286,7 +2286,8 @@ Value *llvm::SimplifyInsertValueInst(Value *Agg, Value *Val,
// insertvalue x, (extractvalue y, n), n
if (ExtractValueInst *EV = dyn_cast<ExtractValueInst>(Val))
- if (EV->getIndices() == Idxs) {
+ if (EV->getAggregateOperand()->getType() == Agg->getType() &&
+ EV->getIndices() == Idxs) {
// insertvalue undef, (extractvalue y, n), n -> y
if (match(Agg, m_Undef()))
return EV->getAggregateOperand();