mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Fix PR3011: LegalizeTypes support for scalarizing
SELECT_CC. llvm-svn: 58706
This commit is contained in:
parent
50183113b9
commit
58ebf09772
@ -452,6 +452,7 @@ private:
|
||||
SDValue ScalarizeVecRes_INSERT_VECTOR_ELT(SDNode *N);
|
||||
SDValue ScalarizeVecRes_LOAD(LoadSDNode *N);
|
||||
SDValue ScalarizeVecRes_SELECT(SDNode *N);
|
||||
SDValue ScalarizeVecRes_SELECT_CC(SDNode *N);
|
||||
SDValue ScalarizeVecRes_UNDEF(SDNode *N);
|
||||
SDValue ScalarizeVecRes_VECTOR_SHUFFLE(SDNode *N);
|
||||
SDValue ScalarizeVecRes_VSETCC(SDNode *N);
|
||||
|
@ -48,6 +48,7 @@ void DAGTypeLegalizer::ScalarizeVectorResult(SDNode *N, unsigned ResNo) {
|
||||
case ISD::INSERT_VECTOR_ELT: R = ScalarizeVecRes_INSERT_VECTOR_ELT(N); break;
|
||||
case ISD::LOAD: R = ScalarizeVecRes_LOAD(cast<LoadSDNode>(N));break;
|
||||
case ISD::SELECT: R = ScalarizeVecRes_SELECT(N); break;
|
||||
case ISD::SELECT_CC: R = ScalarizeVecRes_SELECT_CC(N); break;
|
||||
case ISD::UNDEF: R = ScalarizeVecRes_UNDEF(N); break;
|
||||
case ISD::VECTOR_SHUFFLE: R = ScalarizeVecRes_VECTOR_SHUFFLE(N); break;
|
||||
case ISD::VSETCC: R = ScalarizeVecRes_VSETCC(N); break;
|
||||
@ -162,6 +163,14 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_SELECT(SDNode *N) {
|
||||
GetScalarizedVector(N->getOperand(2)));
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::ScalarizeVecRes_SELECT_CC(SDNode *N) {
|
||||
SDValue LHS = GetScalarizedVector(N->getOperand(2));
|
||||
return DAG.getNode(ISD::SELECT_CC, LHS.getValueType(),
|
||||
N->getOperand(0), N->getOperand(1),
|
||||
LHS, GetScalarizedVector(N->getOperand(3)),
|
||||
N->getOperand(4));
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::ScalarizeVecRes_VECTOR_SHUFFLE(SDNode *N) {
|
||||
// Figure out if the scalar is the LHS or RHS and return it.
|
||||
SDValue Arg = N->getOperand(2).getOperand(0);
|
||||
|
9
test/CodeGen/PowerPC/select-cc.ll
Normal file
9
test/CodeGen/PowerPC/select-cc.ll
Normal file
@ -0,0 +1,9 @@
|
||||
; RUN: llvm-as < %s | llc -march=ppc32
|
||||
; PR3011
|
||||
|
||||
define <2 x double> @vector_select(<2 x double> %x, <2 x double> %y) nounwind {
|
||||
%x.lo = extractelement <2 x double> %x, i32 0 ; <double> [#uses=1]
|
||||
%x.lo.ge = fcmp oge double %x.lo, 0.000000e+00 ; <i1> [#uses=1]
|
||||
%a.d = select i1 %x.lo.ge, <2 x double> %y, <2 x double> %x ; <<2 x double>> [#uses=1]
|
||||
ret <2 x double> %a.d
|
||||
}
|
Loading…
Reference in New Issue
Block a user