Change shouldSplitVectorElementType to better match the description.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 31 Mar 2014 20:54:58 +0000 (20:54 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 31 Mar 2014 20:54:58 +0000 (20:54 +0000)
Pass the entire vector type, and not just the element.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205247 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/NVPTX/NVPTXISelLowering.cpp
lib/Target/NVPTX/NVPTXISelLowering.h
lib/Target/R600/SIISelLowering.cpp
lib/Target/R600/SIISelLowering.h

index b94e8c7651034b1ab7e32c5f3a8602b9c358b0c6..06cc75f4d33c56f5523538ebac881dc87f5f5157 100644 (file)
@@ -183,7 +183,7 @@ public:
   /// Return true if a vector of the given type should be split
   /// (TypeSplitVector) instead of promoted (TypePromoteInteger) during type
   /// legalization.
-  virtual bool shouldSplitVectorElementType(EVT /*VT*/) const { return false; }
+  virtual bool shouldSplitVectorType(EVT /*VT*/) const { return false; }
 
   // There are two general methods for expanding a BUILD_VECTOR node:
   //  1. Use SCALAR_TO_VECTOR on the defined scalar values and then shuffle
index 90e1199caddadda238358c25e86941afad61cc17..870370b7de3ec2f147d45a27180bb429f00beb83 100644 (file)
@@ -1087,7 +1087,7 @@ void TargetLoweringBase::computeRegisterProperties() {
     // that wider vector type.
     MVT EltVT = VT.getVectorElementType();
     unsigned NElts = VT.getVectorNumElements();
-    if (NElts != 1 && !shouldSplitVectorElementType(EltVT)) {
+    if (NElts != 1 && !shouldSplitVectorType(VT)) {
       bool IsLegalWiderType = false;
       // First try to promote the elements of integer vectors. If no legal
       // promotion was found, fallback to the widen-vector method.
index e89dd17efcfcf639af303cf8e2237c24e78fff28..8e25a657afbffc9d4b20373a759397e31a6ffc01 100644 (file)
@@ -331,8 +331,8 @@ const char *NVPTXTargetLowering::getTargetNodeName(unsigned Opcode) const {
   }
 }
 
-bool NVPTXTargetLowering::shouldSplitVectorElementType(EVT VT) const {
-  return VT == MVT::i1;
+bool NVPTXTargetLowering::shouldSplitVectorType(EVT VT) const {
+  return VT.getScalarType() == MVT::i1;
 }
 
 SDValue
index 66e708fcea079eef7baff8d8e2211fee6a2f31c0..c1e8c21958c9dca1ee437967641259469619534a 100644 (file)
@@ -141,7 +141,7 @@ public:
   // PTX always uses 32-bit shift amounts
   virtual MVT getScalarShiftAmountTy(EVT LHSTy) const { return MVT::i32; }
 
-  virtual bool shouldSplitVectorElementType(EVT VT) const;
+  virtual bool shouldSplitVectorType(EVT VT) const override;
 
 private:
   const NVPTXSubtarget &nvptxSubtarget; // cache the subtarget here
index 35bbd82af344c0e84c175f1fcb6ba496ebf30953..0b5541161fff499c243f2f65eb0bb6345f44a80c 100644 (file)
@@ -211,8 +211,8 @@ bool SITargetLowering::allowsUnalignedMemoryAccesses(EVT  VT,
   return VT.bitsGT(MVT::i32);
 }
 
-bool SITargetLowering::shouldSplitVectorElementType(EVT VT) const {
-  return VT.bitsLE(MVT::i16);
+bool SITargetLowering::shouldSplitVectorType(EVT VT) const {
+  return VT.getScalarType().bitsLE(MVT::i16);
 }
 
 bool SITargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
index 9d53ba5259d013419acb4ef1b40ad2b6d09b6029..ca73f53f22207ee8dc954fb1c6cf488cfb98ef73 100644 (file)
@@ -50,7 +50,7 @@ class SITargetLowering : public AMDGPUTargetLowering {
 public:
   SITargetLowering(TargetMachine &tm);
   bool allowsUnalignedMemoryAccesses(EVT VT, unsigned AS, bool *IsFast) const;
-  virtual bool shouldSplitVectorElementType(EVT VT) const;
+  virtual bool shouldSplitVectorType(EVT VT) const override;
 
   virtual bool shouldConvertConstantLoadToIntImm(const APInt &Imm,
                                                  Type *Ty) const override;