aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-01-03 02:34:09 +0000
committerHal Finkel <hfinkel@anl.gov>2013-01-03 02:34:09 +0000
commit82860f63e1678077fe665c21179b9df47fd313bb (patch)
tree771f722fcf336a1b1a88c1090fb01f39c86ef371
parente5ab1bee8c1b4ae58bc108c28194af56379e55ac (diff)
downloadexternal_llvm-82860f63e1678077fe665c21179b9df47fd313bb.zip
external_llvm-82860f63e1678077fe665c21179b9df47fd313bb.tar.gz
external_llvm-82860f63e1678077fe665c21179b9df47fd313bb.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171453 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Target/TargetTransformImpl.h2
-rw-r--r--include/llvm/TargetTransformInfo.h6
-rw-r--r--lib/Target/TargetTransformImpl.cpp3
-rw-r--r--lib/Target/X86/X86ISelLowering.cpp5
-rw-r--r--lib/Target/X86/X86ISelLowering.h3
5 files changed, 10 insertions, 9 deletions
diff --git a/include/llvm/Target/TargetTransformImpl.h b/include/llvm/Target/TargetTransformImpl.h
index 3b6ed1a..bbdb4f1 100644
--- a/include/llvm/Target/TargetTransformImpl.h
+++ b/include/llvm/Target/TargetTransformImpl.h
@@ -72,7 +72,7 @@ public:
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;
diff --git a/include/llvm/TargetTransformInfo.h b/include/llvm/TargetTransformInfo.h
index 6336afc..1dc2b07 100644
--- a/include/llvm/TargetTransformInfo.h
+++ b/include/llvm/TargetTransformInfo.h
@@ -170,10 +170,10 @@ public:
}
/// 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;
}
diff --git a/lib/Target/TargetTransformImpl.cpp b/lib/Target/TargetTransformImpl.cpp
index d7c221e..f8c5889 100644
--- a/lib/Target/TargetTransformImpl.cpp
+++ b/lib/Target/TargetTransformImpl.cpp
@@ -209,8 +209,7 @@ unsigned VectorTargetTransformImpl::getArithmeticInstrCost(unsigned Opcode,
}
unsigned VectorTargetTransformImpl::getShuffleCost(ShuffleKind Kind,
- Type *Tp,
- int Index) const {
+ Type *Tp, int Index, Type *SubTp) const {
return 1;
}
diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp
index 4afc0d8..eca63f8 100644
--- a/lib/Target/X86/X86ISelLowering.cpp
+++ b/lib/Target/X86/X86ISelLowering.cpp
@@ -18303,10 +18303,11 @@ unsigned X86VectorTargetTransformInfo::getCastInstrCost(unsigned Opcode,
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;
diff --git a/lib/Target/X86/X86ISelLowering.h b/lib/Target/X86/X86ISelLowering.h
index 1b4b5eb..2e2fc2a 100644
--- a/lib/Target/X86/X86ISelLowering.h
+++ b/lib/Target/X86/X86ISelLowering.h
@@ -974,7 +974,8 @@ namespace llvm {
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;
};
}