1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Don't use getSetCCResultType for creating a vselect

The vselect mask isn't a setcc.

This breaks in the case when the result of getSetCCResultType
is larger than the vector operands

e.g. %tmp = select i1 %cmp <2 x i8> %a, <2 x i8> %b
when getSetCCResultType returns <2 x i32>, the assertion
that the (MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits())
is hit.

No test since I don't think I can hit this with any of the current
targets. The R600/SI implementation would break, since it returns a
vector of i1 for this, but it doesn't reach ExpandSELECT for other
reasons.

llvm-svn: 190376
This commit is contained in:
Matt Arsenault 2013-09-10 00:41:56 +00:00
parent eeee915ad0
commit aaf9a88c18

View File

@ -599,8 +599,7 @@ SDValue VectorLegalizer::ExpandSELECT(SDValue Op) {
return DAG.UnrollVectorOp(Op.getNode());
// Generate a mask operand.
EVT MaskTy = TLI.getSetCCResultType(*DAG.getContext(), VT);
assert(MaskTy.isVector() && "Invalid CC type");
EVT MaskTy = VT.changeVectorElementTypeToInteger();
assert(MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits()
&& "Invalid mask size");