diff options
author | Chris Lattner <sabre@nondot.org> | 2006-04-16 01:36:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-04-16 01:36:45 +0000 |
commit | 2efce0a589e2a688a1a06b5dc2ed0db32ae79924 (patch) | |
tree | 22d763d80dcc82d02633a87500be6e814d097e7a | |
parent | b17f1679e3ce2b40fc2141fc50ef3def4bbd00bc (diff) |
Add support for promoting stores from one legal type to another, allowing us
to write one pattern for vector stores instead of 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27730 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 9b2d5508b7..7cf71418fa 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1544,6 +1544,13 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { Tmp1 = TLI.LowerOperation(Result, DAG); if (Tmp1.Val) Result = Tmp1; break; + case TargetLowering::Promote: + assert(MVT::isVector(VT) && "Unknown legal promote case!"); + Tmp3 = DAG.getNode(ISD::BIT_CONVERT, + TLI.getTypeToPromoteTo(ISD::STORE, VT), Tmp3); + Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp3, Tmp2, + Node->getOperand(3)); + break; } break; } @@ -1576,6 +1583,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { Tmp3 = PackVectorOp(Node->getOperand(1), TVT); Result = DAG.UpdateNodeOperands(Result, Tmp1, Tmp3, Tmp2, Node->getOperand(3)); + Result = LegalizeOp(Result); break; } else if (NumElems == 1) { // Turn this into a normal store of the scalar type. |