diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-04-12 20:30:10 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-04-12 20:30:10 +0000 |
| commit | 0b73a6d8bceb6b1575918b56868a838f900a8083 (patch) | |
| tree | e6fdb73c82f6d9eaf2efc4d881bbfd66214864c5 /llvm/lib/CodeGen/SelectionDAG | |
| parent | 9daef352e9761c6e206ecb84dfe733f9fae5d5d5 (diff) | |
| download | bcm5719-llvm-0b73a6d8bceb6b1575918b56868a838f900a8083.tar.gz bcm5719-llvm-0b73a6d8bceb6b1575918b56868a838f900a8083.zip | |
promote extload i1 -> extload i8
llvm-svn: 21258
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 7965e141a54..6ea58519f8f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -448,8 +448,17 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { MVT::ValueType SrcVT = cast<MVTSDNode>(Node)->getExtraValueType(); switch (TLI.getOperationAction(Node->getOpcode(), SrcVT)) { - case TargetLowering::Promote: default: assert(0 && "This action is not supported yet!"); + case TargetLowering::Promote: + assert(SrcVT == MVT::i1 && "Can only promote EXTLOAD from i1 -> i8!"); + Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), + Tmp1, Tmp2, MVT::i8); + // Since loads produce two values, make sure to remember that we legalized + // both of them. + AddLegalizedOperand(SDOperand(Node, 0), Result); + AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1)); + return Result.getValue(Op.ResNo); + case TargetLowering::Legal: if (Tmp1 != Node->getOperand(0) || Tmp2 != Node->getOperand(1)) @@ -463,7 +472,6 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { AddLegalizedOperand(SDOperand(Node, 0), Result); AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1)); return Result.getValue(Op.ResNo); - break; case TargetLowering::Expand: assert(Node->getOpcode() != ISD::EXTLOAD && "EXTLOAD should always be supported!"); |

