[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue May 10 21:51:33 PDT 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
LegalizeDAG.cpp updated: 1.98 -> 1.99
---
Log message:
implement expansion of ctpop nodes, implementing CodeGen/Generic/llvm-ct-intrinsics.ll
---
Diffs of the changes: (+16 -5)
LegalizeDAG.cpp | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.98 llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.99
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.98 Mon May 9 15:36:57 2005
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Tue May 10 23:51:16 2005
@@ -635,16 +635,16 @@
if (!TLI.isLittleEndian())
std::swap(Lo, Hi);
- Lo = DAG.getNode(ISD::STORE, MVT::Other,Tmp1, Lo, Tmp2,Node->getOperand(3));
-
+ Lo = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, Lo, Tmp2,
+ Node->getOperand(3));
unsigned IncrementSize = MVT::getSizeInBits(Hi.getValueType())/8;
Tmp2 = DAG.getNode(ISD::ADD, Tmp2.getValueType(), Tmp2,
getIntPtrConstant(IncrementSize));
assert(isTypeLegal(Tmp2.getValueType()) &&
"Pointers must be legal!");
//Again, claiming both parts of the store came form the same Instr
- Hi = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, Hi, Tmp2, Node->getOperand(3));
-
+ Hi = DAG.getNode(ISD::STORE, MVT::Other, Tmp1, Hi, Tmp2,
+ Node->getOperand(3));
Result = DAG.getNode(ISD::TokenFactor, MVT::Other, Lo, Hi);
break;
}
@@ -1079,7 +1079,8 @@
case TargetLowering::Promote: {
MVT::ValueType OVT = Tmp1.getValueType();
MVT::ValueType NVT = TLI.getTypeToPromoteTo(Node->getOpcode(), OVT);
- //Zero extend the argument
+
+ // Zero extend the argument.
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, NVT, Tmp1);
// Perform the larger operation, then subtract if needed.
Tmp1 = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1);
@@ -2170,6 +2171,16 @@
Hi = LegalizeOp(Node->getOperand(1));
break;
+ case ISD::CTPOP:
+ ExpandOp(Node->getOperand(0), Lo, Hi);
+ Lo = DAG.getNode(ISD::ADD, NVT, Lo, Hi);
+ Hi = DAG.getConstant(0, NVT);
+ break;
+
+ case ISD::CTTZ:
+ case ISD::CTLZ:
+ assert(0 && "ct intrinsics cannot be expanded!");
+
case ISD::LOAD: {
SDOperand Ch = LegalizeOp(Node->getOperand(0)); // Legalize the chain.
SDOperand Ptr = LegalizeOp(Node->getOperand(1)); // Legalize the pointer.
More information about the llvm-commits
mailing list