[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jan 28 14:29:35 PST 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.54 -> 1.55
---
Log message:
Get alpha working with memset/memcpy/memmove
---
Diffs of the changes: (+29 -5)
LegalizeDAG.cpp | 34 +++++++++++++++++++++++++++++-----
1 files changed, 29 insertions(+), 5 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.54 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.55
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.54 Fri Jan 28 00:27:38 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Jan 28 16:29:18 2005
@@ -706,11 +706,35 @@
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!");
More information about the llvm-commits
mailing list