aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetTransformImpl.h3
-rw-r--r--include/llvm/TargetTransformInfo.h11
2 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/Target/TargetTransformImpl.h b/include/llvm/Target/TargetTransformImpl.h
index f2229748be..3b6ed1abd3 100644
--- a/include/llvm/Target/TargetTransformImpl.h
+++ b/include/llvm/Target/TargetTransformImpl.h
@@ -71,7 +71,8 @@ public:
virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const;
- virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp) const;
+ virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
+ int Index) const;
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
Type *Src) const;
diff --git a/include/llvm/TargetTransformInfo.h b/include/llvm/TargetTransformInfo.h
index 1a5dda3bb2..c97c7e4b0d 100644
--- a/include/llvm/TargetTransformInfo.h
+++ b/include/llvm/TargetTransformInfo.h
@@ -158,8 +158,10 @@ public:
virtual ~VectorTargetTransformInfo() {}
enum ShuffleKind {
- Broadcast, // Broadcast element 0 to all other elements.
- Reverse // Reverse the order of the vector.
+ Broadcast, // Broadcast element 0 to all other elements.
+ Reverse, // Reverse the order of the vector.
+ InsertSubvector, // InsertSubvector. Index indicates start offset.
+ ExtractSubvector // ExtractSubvector Index indicates start offset.
};
/// Returns the expected cost of arithmetic ops, such as mul, xor, fsub, etc.
@@ -168,7 +170,10 @@ public:
}
/// Returns the cost of a shuffle instruction of kind Kind and of type Tp.
- virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp) const {
+ /// The index parameter is used by some of the shuffle kinds to add
+ /// additional information.
+ virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
+ int Index) const {
return 1;
}