[llvm-commits] [llvm] r43195 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Dale Johannesen dalej at apple.com
Fri Oct 19 17:07:54 PDT 2007


Author: johannes
Date: Fri Oct 19 19:07:52 2007
New Revision: 43195

URL: http://llvm.org/viewvc/llvm-project?rev=43195&view=rev
Log:
Fix a few places vector operations were not getting
the operand's type from the right place.


Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp?rev=43195&r1=43194&r2=43195&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp Fri Oct 19 19:07:52 2007
@@ -1919,8 +1919,9 @@
           Result = LegalizeOp(Result);
         } else {
           SDNode *InVal = Tmp2.Val;
-          unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(0));
-          MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(0));
+          int InIx = Tmp2.ResNo;
+          unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(InIx));
+          MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(InIx));
           
           // Figure out if there is a simple type corresponding to this Vector
           // type.  If so, convert to the vector type.
@@ -2114,8 +2115,9 @@
         // in the high half of the vector.
         if (MVT::isVector(ST->getValue().getValueType())) {
           SDNode *InVal = ST->getValue().Val;
-          unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(0));
-          MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(0));
+          int InIx = ST->getValue().ResNo;
+          unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(InIx));
+          MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(InIx));
 
           // Figure out if there is a simple type corresponding to this Vector
           // type.  If so, convert to the vector type.
@@ -3260,8 +3262,9 @@
       // The input has to be a vector type, we have to either scalarize it, pack
       // it, or convert it based on whether the input vector type is legal.
       SDNode *InVal = Node->getOperand(0).Val;
-      unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(0));
-      MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(0));
+      int InIx = Node->getOperand(0).ResNo;
+      unsigned NumElems = MVT::getVectorNumElements(InVal->getValueType(InIx));
+      MVT::ValueType EVT = MVT::getVectorElementType(InVal->getValueType(InIx));
     
       // Figure out if there is a simple type corresponding to this Vector
       // type.  If so, convert to the vector type.





More information about the llvm-commits mailing list