From e560521f1af300a10717ca5c73d42df9ffb1b121 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 28 Jan 2005 22:29:18 +0000 Subject: [PATCH] Get alpha working with memset/memcpy/memmove git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19878 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 34 ++++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index b48c1b6aaba..32cf5970726 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -706,11 +706,35 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { case ISD::MEMSET: case ISD::MEMCPY: case ISD::MEMMOVE: { - Tmp1 = LegalizeOp(Node->getOperand(0)); - Tmp2 = LegalizeOp(Node->getOperand(1)); - Tmp3 = LegalizeOp(Node->getOperand(2)); - SDOperand Tmp4 = LegalizeOp(Node->getOperand(3)); - SDOperand Tmp5 = LegalizeOp(Node->getOperand(4)); + Tmp1 = LegalizeOp(Node->getOperand(0)); // Function + Tmp2 = LegalizeOp(Node->getOperand(1)); // Pointer + + if (Node->getOpcode() == ISD::MEMSET) { // memset = ubyte + switch (getTypeAction(Node->getOperand(2).getValueType())) { + case Expand: assert(0 && "Cannot expand a byte!"); + case Legal: + Tmp3 = LegalizeOp(Node->getOperand(1)); + break; + case Promote: + Tmp3 = PromoteOp(Node->getOperand(1)); + break; + } + } else { + Tmp3 = LegalizeOp(Node->getOperand(2)); // memcpy/move = pointer, + } + SDOperand Tmp4, Tmp5; + + switch (getTypeAction(Node->getOperand(3).getValueType())) { // uint + case Expand: assert(0 && "Cannot expand this yet!"); + case Legal: + Tmp4 = LegalizeOp(Node->getOperand(3)); + Tmp5 = LegalizeOp(Node->getOperand(4)); + break; + case Promote: + Tmp4 = PromoteOp(Node->getOperand(3)); + Tmp5 = PromoteOp(Node->getOperand(4)); + break; + } switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) { default: assert(0 && "This action not implemented for this operation!"); -- 2.34.1