[llvm-commits] [llvm] r53554 - /llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Duncan Sands baldrick at free.fr
Mon Jul 14 10:22:31 PDT 2008


Author: baldrick
Date: Mon Jul 14 12:22:31 2008
New Revision: 53554

URL: http://llvm.org/viewvc/llvm-project?rev=53554&view=rev
Log:
There should be no extending loads or truncating
stores of one-element vectors.  Also, neaten the
handling of INSERT_VECTOR_ELT when the inserted
type is larger than the vector element type.

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

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

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp Mon Jul 14 12:22:31 2008
@@ -85,7 +85,7 @@
 }
 
 SDOperand DAGTypeLegalizer::ScalarizeVecRes_LOAD(LoadSDNode *N) {
-  assert(ISD::isUNINDEXEDLoad(N) && "Indexed load during type legalization!");
+  assert(ISD::isNormalLoad(N) && "Extending load of one-element vector?");
   SDOperand Result = DAG.getLoad(N->getValueType(0).getVectorElementType(),
                                  N->getChain(), N->getBasePtr(),
                                  N->getSrcValue(), N->getSrcValueOffset(),
@@ -118,9 +118,9 @@
   // so be sure to truncate it to the element type if necessary.
   SDOperand Op = N->getOperand(1);
   MVT EltVT = N->getValueType(0).getVectorElementType();
-  if (Op.getValueType().bitsGT(EltVT))
+  if (Op.getValueType() != EltVT)
+    // FIXME: Can this happen for floating point types?
     Op = DAG.getNode(ISD::TRUNCATE, EltVT, Op);
-  assert(Op.getValueType() == EltVT && "Invalid type for inserted value!");
   return Op;
 }
 
@@ -210,7 +210,7 @@
 /// ScalarizeVecOp_STORE - If the value to store is a vector that needs to be
 /// scalarized, it must be <1 x ty>.  Just store the element.
 SDOperand DAGTypeLegalizer::ScalarizeVecOp_STORE(StoreSDNode *N, unsigned OpNo){
-  assert(ISD::isUNINDEXEDStore(N) && "Indexed store during type legalization!");
+  assert(ISD::isNormalStore(N) && "Truncating store of one-element vector?");
   assert(OpNo == 1 && "Do not know how to scalarize this operand!");
   return DAG.getStore(N->getChain(), GetScalarizedVector(N->getOperand(1)),
                       N->getBasePtr(), N->getSrcValue(), N->getSrcValueOffset(),





More information about the llvm-commits mailing list