aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-10-17 14:48:28 +0000
committerDan Gohman <gohman@apple.com>2007-10-17 14:48:28 +0000
commitc623096fe227a7705ccac5a5db514b64ccdfe6b2 (patch)
tree51f3b3189b2492a7eed0305b3efcd879985852de /lib
parentf411b83c8c6853c2a922b692e782566353153f08 (diff)
downloadexternal_llvm-c623096fe227a7705ccac5a5db514b64ccdfe6b2.zip
external_llvm-c623096fe227a7705ccac5a5db514b64ccdfe6b2.tar.gz
external_llvm-c623096fe227a7705ccac5a5db514b64ccdfe6b2.tar.bz2
Add support for ISD::SELECT in SplitVectorOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index dfb7f30..da2c1dc 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -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: