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 | 91226e57999594538bf4ce352a165bd2582c9ad1 (patch) | |
| tree | 7eec4a0d825de21201181be8fa7a005bee4dae5f /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
| parent | fa5aa396c251c42ce127407c075e296bff0f88b1 (diff) | |
| download | bcm5719-llvm-91226e57999594538bf4ce352a165bd2582c9ad1.tar.gz bcm5719-llvm-91226e57999594538bf4ce352a165bd2582c9ad1.zip | |
Add support for promoting stores from one legal type to another, allowing us
to write one pattern for vector stores instead of 4.
llvm-svn: 27730
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 9b2d5508b71..7cf71418fa7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/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. |

