[llvm-commits] [llvm] r44608 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp
Chris Lattner
sabre at nondot.org
Tue Dec 4 23:45:02 PST 2007
Author: lattner
Date: Wed Dec 5 01:45:02 2007
New Revision: 44608
URL: http://llvm.org/viewvc/llvm-project?rev=44608&view=rev
Log:
more scalarization
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp?rev=44608&r1=44607&r2=44608&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAGTypes.cpp Wed Dec 5 01:45:02 2007
@@ -207,6 +207,10 @@
SDOperand ScalarizeRes_UNDEF(SDNode *N);
SDOperand ScalarizeRes_LOAD(LoadSDNode *N);
SDOperand ScalarizeRes_BinOp(SDNode *N);
+ SDOperand ScalarizeRes_UnaryOp(SDNode *N);
+ SDOperand ScalarizeRes_FPOWI(SDNode *N);
+ SDOperand ScalarizeRes_BUILD_VECTOR(SDNode *N);
+ SDOperand ScalarizeRes_INSERT_VECTOR_ELT(SDNode *N);
// Operand Promotion.
bool PromoteOperand(SDNode *N, unsigned OperandNo);
@@ -1647,6 +1651,14 @@
case ISD::AND:
case ISD::OR:
case ISD::XOR: R = ScalarizeRes_BinOp(N); break;
+ case ISD::FNEG:
+ case ISD::FABS:
+ case ISD::FSQRT:
+ case ISD::FSIN:
+ case ISD::FCOS: R = ScalarizeRes_UnaryOp(N); break;
+ case ISD::FPOWI: R = ScalarizeRes_FPOWI(N); break;
+ case ISD::BUILD_VECTOR: R = ScalarizeRes_BUILD_VECTOR(N); break;
+ case ISD::INSERT_VECTOR_ELT: R = ScalarizeRes_INSERT_VECTOR_ELT(N); break;
}
// If R is null, the sub-method took care of registering the resul.
@@ -1676,6 +1688,24 @@
return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, RHS);
}
+SDOperand DAGTypeLegalizer::ScalarizeRes_UnaryOp(SDNode *N) {
+ SDOperand Op = GetScalarizedOp(N->getOperand(0));
+ return DAG.getNode(N->getOpcode(), Op.getValueType(), Op);
+}
+
+SDOperand DAGTypeLegalizer::ScalarizeRes_FPOWI(SDNode *N) {
+ SDOperand Op = GetScalarizedOp(N->getOperand(0));
+ return DAG.getNode(ISD::FPOWI, Op.getValueType(), Op, N->getOperand(1));
+}
+
+SDOperand DAGTypeLegalizer::ScalarizeRes_BUILD_VECTOR(SDNode *N) {
+ return N->getOperand(0);
+}
+
+SDOperand DAGTypeLegalizer::ScalarizeRes_INSERT_VECTOR_ELT(SDNode *N) {
+ return N->getOperand(1); // Returning the inserted scalar element.
+}
+
//===----------------------------------------------------------------------===//
// Operand Promotion
More information about the llvm-commits
mailing list