[llvm-commits] [llvm] r171453 - in /llvm/trunk: include/llvm/Target/TargetTransformImpl.h include/llvm/TargetTransformInfo.h lib/Target/TargetTransformImpl.cpp lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h

Hal Finkel hfinkel at anl.gov
Wed Jan 2 18:34:10 PST 2013


Author: hfinkel
Date: Wed Jan  2 20:34:09 2013
New Revision: 171453

URL: http://llvm.org/viewvc/llvm-project?rev=171453&view=rev
Log:
Add a subtype parameter to VTTI::getShuffleCost

In order to cost subvector insertion and extraction, we need to know
the type of the subvector being extracted.

No functionality change.

Modified:
    llvm/trunk/include/llvm/Target/TargetTransformImpl.h
    llvm/trunk/include/llvm/TargetTransformInfo.h
    llvm/trunk/lib/Target/TargetTransformImpl.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
    llvm/trunk/lib/Target/X86/X86ISelLowering.h

Modified: llvm/trunk/include/llvm/Target/TargetTransformImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetTransformImpl.h?rev=171453&r1=171452&r2=171453&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetTransformImpl.h (original)
+++ llvm/trunk/include/llvm/Target/TargetTransformImpl.h Wed Jan  2 20:34:09 2013
@@ -72,7 +72,7 @@
   virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const;
 
   virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
-                                  int Index) const;
+                                  int Index, Type *SubTp) const;
 
   virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
                                     Type *Src) const;

Modified: llvm/trunk/include/llvm/TargetTransformInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TargetTransformInfo.h?rev=171453&r1=171452&r2=171453&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TargetTransformInfo.h (original)
+++ llvm/trunk/include/llvm/TargetTransformInfo.h Wed Jan  2 20:34:09 2013
@@ -170,10 +170,10 @@
   }
 
   /// Returns the cost of a shuffle instruction of kind Kind and of type Tp.
-  /// The index parameter is used by some of the shuffle kinds to add
-  /// additional information.
+  /// The index and subtype parameters are used by some of the shuffle kinds
+  /// to add additional information.
   virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
-                                  int Index = 0) const {
+                                  int Index = 0, Type *SubTp = 0) const {
     return 1;
   }
 

Modified: llvm/trunk/lib/Target/TargetTransformImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetTransformImpl.cpp?rev=171453&r1=171452&r2=171453&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetTransformImpl.cpp (original)
+++ llvm/trunk/lib/Target/TargetTransformImpl.cpp Wed Jan  2 20:34:09 2013
@@ -209,8 +209,7 @@
 }
 
 unsigned VectorTargetTransformImpl::getShuffleCost(ShuffleKind Kind,
-                                                   Type *Tp,
-                                                   int Index) const {
+                                  Type *Tp, int Index, Type *SubTp) const {
   return 1;
 }
 

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=171453&r1=171452&r2=171453&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Wed Jan  2 20:34:09 2013
@@ -18303,10 +18303,11 @@
 
 
 unsigned X86VectorTargetTransformInfo::getShuffleCost(ShuffleKind Kind, Type *Tp,
-                                                      int Index) const {
+                                                      int Index,
+                                                      Type *SubTp) const {
   // We only estimate the cost of reverse shuffles.
   if (Kind != Reverse)
-    return VectorTargetTransformImpl::getShuffleCost(Kind, Tp, Index);
+    return VectorTargetTransformImpl::getShuffleCost(Kind, Tp, Index, SubTp);
 
   std::pair<unsigned, MVT> LT = getTypeLegalizationCost(Tp);
   unsigned Cost = 1;

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.h?rev=171453&r1=171452&r2=171453&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.h (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.h Wed Jan  2 20:34:09 2013
@@ -974,7 +974,8 @@
     virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
                                       Type *Src) const;
 
-    unsigned getShuffleCost(ShuffleKind Kind, Type *Tp, int Index) const;
+    unsigned getShuffleCost(ShuffleKind Kind,
+                            Type *Tp, int Index, Type *SubTp) const;
   };
 }
 





More information about the llvm-commits mailing list