[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Chris Lattner lattner at cs.uiuc.edu
Wed May 17 13:49:49 PDT 2006



Changes in directory llvm/lib/CodeGen/SelectionDAG:

SelectionDAGISel.cpp updated: 1.246 -> 1.247
---
Log message:

Fix the result of the call to use a correct vbitconvert.  There is no need to
use getPackedTypeBreakdown at all here.


---
Diffs of the changes:  (+8 -23)

 SelectionDAGISel.cpp |   31 ++++++++-----------------------
 1 files changed, 8 insertions(+), 23 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.246 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.247
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.246	Wed May 17 15:43:21 2006
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp	Wed May 17 15:49:36 2006
@@ -2455,25 +2455,15 @@
 
         // Figure out if there is a Packed type corresponding to this Vector
         // type.  If so, convert to the packed type.
-        bool Supported = false;
         MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
-        if (TVT != MVT::Other) {
+        if (TVT != MVT::Other && isTypeLegal(TVT)) {
           SDOperand N = SDOperand(Result, i++);
           // Handle copies from generic vectors to registers.
-          MVT::ValueType PTyElementVT, PTyLegalElementVT;
-          unsigned NE = getPackedTypeBreakdown(PTy, PTyElementVT,
-                                               PTyLegalElementVT);
-          // FIXME: handle NE > 1 cases.
-          if (NE == 1) {
-            N = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, N,
-                            DAG.getConstant(NumElems, MVT::i32), 
-                            DAG.getValueType(getValueType(EltTy)));
-            Ops.push_back(N);
-            Supported = true;
-          }
-        }
-
-        if (!Supported) {
+          N = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, N,
+                          DAG.getConstant(NumElems, MVT::i32), 
+                          DAG.getValueType(getValueType(EltTy)));
+          Ops.push_back(N);
+        } else {
           assert(0 && "Don't support illegal by-val vector arguments yet!");
           abort();
         }
@@ -2633,16 +2623,11 @@
           // type.  If so, convert to the packed type.
           MVT::ValueType TVT = MVT::getVectorType(getValueType(EltTy), NumElems);
           if (TVT != MVT::Other && isTypeLegal(TVT)) {
-            // Handle copies from generic vectors to registers.
-            MVT::ValueType PTyElementVT, PTyLegalElementVT;
-            unsigned NE = getPackedTypeBreakdown(cast<PackedType>(RetTy),
-                                                 PTyElementVT,
-                                                 PTyLegalElementVT);
             // Insert a VBIT_CONVERT of the FORMAL_ARGUMENTS to a
             // "N x PTyElementVT" MVT::Vector type.
             ResVal = DAG.getNode(ISD::VBIT_CONVERT, MVT::Vector, ResVal,
-                                 DAG.getConstant(NE, MVT::i32), 
-                                 DAG.getValueType(PTyElementVT));
+                                 DAG.getConstant(NumElems, MVT::i32), 
+                                 DAG.getValueType(getValueType(EltTy)));
           } else {
             abort();
           }






More information about the llvm-commits mailing list