When emulating vselect using OR/AND/XOR make sure to bitcast the result back to the original type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154764 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nadav Rotem 2012-04-15 15:08:09 +00:00
parent 73c504af9d
commit 3ab32ea49e
2 changed files with 10 additions and 1 deletions

View File

@ -417,7 +417,8 @@ SDValue VectorLegalizer::ExpandVSELECT(SDValue Op) {
Op1 = DAG.getNode(ISD::AND, DL, VT, Op1, Mask);
Op2 = DAG.getNode(ISD::AND, DL, VT, Op2, NotMask);
return DAG.getNode(ISD::OR, DL, VT, Op1, Op2);
SDValue Val = DAG.getNode(ISD::OR, DL, VT, Op1, Op2);
return DAG.getNode(ISD::BITCAST, DL, Op.getValueType(), Val);
}
SDValue VectorLegalizer::ExpandUINT_TO_FLOAT(SDValue Op) {

View File

@ -80,3 +80,11 @@ define <2 x double> @B(<2 x double> %x, <2 x double> %y) {
ret <2 x double> %min
}
; CHECK: float_crash
define void @float_crash() nounwind {
entry:
%merge205vector_func.i = select <4 x i1> undef, <4 x double> undef, <4 x double> undef
%extract214vector_func.i = extractelement <4 x double> %merge205vector_func.i, i32 0
store double %extract214vector_func.i, double addrspace(1)* undef, align 8
ret void
}