mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 22:28:18 +00:00
Fix a regression in test/CodeGen/X86/2007-04-24-VectorCrash.ll introduced
by r43510. Gracefully handle constants with vector type that aren't ConstantVector or ConstantAggregateZero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43579 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -716,10 +716,8 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
|
|||||||
} else if (const VectorType *VTy = dyn_cast<VectorType>(C1->getType())) {
|
} else if (const VectorType *VTy = dyn_cast<VectorType>(C1->getType())) {
|
||||||
const ConstantVector *CP1 = dyn_cast<ConstantVector>(C1);
|
const ConstantVector *CP1 = dyn_cast<ConstantVector>(C1);
|
||||||
const ConstantVector *CP2 = dyn_cast<ConstantVector>(C2);
|
const ConstantVector *CP2 = dyn_cast<ConstantVector>(C2);
|
||||||
assert((CP1 != NULL || isa<ConstantAggregateZero>(C1)) &&
|
if ((CP1 != NULL || isa<ConstantAggregateZero>(C1)) &&
|
||||||
"Unexpected kind of vector constant!");
|
(CP2 != NULL || isa<ConstantAggregateZero>(C2))) {
|
||||||
assert((CP2 != NULL || isa<ConstantAggregateZero>(C2)) &&
|
|
||||||
"Unexpected kind of vector constant!");
|
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -747,6 +745,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode,
|
|||||||
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getOr);
|
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getOr);
|
||||||
case Instruction::Xor:
|
case Instruction::Xor:
|
||||||
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getXor);
|
return EvalVectorOp(CP1, CP2, VTy, ConstantExpr::getXor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user