mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
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
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user