mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 20:34:58 +00:00
Add support for ISD::SELECT in SplitVectorOp.
llvm-svn: 43072
This commit is contained in:
parent
0a5a15c3a0
commit
2903f7fc26
@ -6225,6 +6225,26 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ISD::SELECT: {
|
||||
SDOperand Cond = Node->getOperand(0);
|
||||
|
||||
SDOperand LL, LH, RL, RH;
|
||||
SplitVectorOp(Node->getOperand(1), LL, LH);
|
||||
SplitVectorOp(Node->getOperand(2), RL, RH);
|
||||
|
||||
if (MVT::isVector(Cond.getValueType())) {
|
||||
// Handle a vector merge.
|
||||
SDOperand CL, CH;
|
||||
SplitVectorOp(Cond, CL, CH);
|
||||
Lo = DAG.getNode(Node->getOpcode(), NewVT, CL, LL, RL);
|
||||
Hi = DAG.getNode(Node->getOpcode(), NewVT, CH, LH, RH);
|
||||
} else {
|
||||
// Handle a simple select with vector operands.
|
||||
Lo = DAG.getNode(Node->getOpcode(), NewVT, Cond, LL, RL);
|
||||
Hi = DAG.getNode(Node->getOpcode(), NewVT, Cond, LH, RH);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ISD::ADD:
|
||||
case ISD::SUB:
|
||||
case ISD::MUL:
|
||||
|
7
test/CodeGen/X86/split-select.ll
Normal file
7
test/CodeGen/X86/split-select.ll
Normal file
@ -0,0 +1,7 @@
|
||||
; RUN: llvm-as < %s | llc -march=x86-64 | grep test | count 1
|
||||
|
||||
define void @foo(i1 %c, <2 x float> %a, <2 x float> %b, <2 x float>* %p) {
|
||||
%x = select i1 %c, <2 x float> %a, <2 x float> %b
|
||||
store <2 x float> %x, <2 x float>* %p
|
||||
ret void
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user