[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Oct 13 14:44:59 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.197 -> 1.198
---
Log message:
When ExpandOp'ing a [SZ]EXTLOAD, make sure to remember that the chain
is also legal. Add support for ExpandOp'ing raw EXTLOADs too.
---
Diffs of the changes: (+28 -2)
LegalizeDAG.cpp | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.197 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.198
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.197 Thu Oct 13 15:07:41 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Thu Oct 13 16:44:47 2005
@@ -3121,6 +3121,10 @@
else
Lo = DAG.getExtLoad(ISD::SEXTLOAD, NVT, Chain, Ptr, Node->getOperand(2),
EVT);
+
+ // Remember that we legalized the chain.
+ AddLegalizedOperand(SDOperand(Node, 1), Lo.getValue(1));
+
// The high part is obtained by SRA'ing all but one of the bits of the lo
// part.
unsigned LoSize = MVT::getSizeInBits(Lo.getValueType());
@@ -3140,10 +3144,32 @@
else
Lo = DAG.getExtLoad(ISD::ZEXTLOAD, NVT, Chain, Ptr, Node->getOperand(2),
EVT);
+
+ // Remember that we legalized the chain.
+ AddLegalizedOperand(SDOperand(Node, 1), Lo.getValue(1));
+
// The high part is just a zero.
- Hi = DAG.getConstant(0, NVT);
+ Hi = LegalizeOp(DAG.getConstant(0, NVT));
+ Lo = LegalizeOp(Lo);
+ break;
+ }
+ case ISD::EXTLOAD: {
+ SDOperand Chain = LegalizeOp(Node->getOperand(0));
+ SDOperand Ptr = LegalizeOp(Node->getOperand(1));
+ MVT::ValueType EVT = cast<VTSDNode>(Node->getOperand(3))->getVT();
+
+ if (EVT == NVT)
+ Lo = DAG.getLoad(NVT, Chain, Ptr, Node->getOperand(2));
+ else
+ Lo = DAG.getExtLoad(ISD::EXTLOAD, NVT, Chain, Ptr, Node->getOperand(2),
+ EVT);
+
+ // Remember that we legalized the chain.
+ AddLegalizedOperand(SDOperand(Node, 1), Lo.getValue(1));
+
+ // The high part is undefined.
+ Hi = LegalizeOp(DAG.getNode(ISD::UNDEF, NVT));
Lo = LegalizeOp(Lo);
- Hi = LegalizeOp(Hi);
break;
}
case ISD::ANY_EXTEND: {
More information about the llvm-commits
mailing list