aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-04-12 20:30:10 +0000
committerChris Lattner <sabre@nondot.org>2005-04-12 20:30:10 +0000
commit1c51c6ac13b5e68b099605021784c7f552dcce3c (patch)
tree8cda3f404ef98fa11e616ebed5b94cd99175f4c4
parent3464547968b58dda0acbf6e0e192f03f66652848 (diff)
promote extload i1 -> extload i8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21258 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 7965e141a5..6ea58519f8 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/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!");