diff options
Diffstat (limited to 'include/llvm/TargetTransformInfo.h')
-rw-r--r-- | include/llvm/TargetTransformInfo.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/TargetTransformInfo.h b/include/llvm/TargetTransformInfo.h index 718d4bcfea..1a5dda3bb2 100644 --- a/include/llvm/TargetTransformInfo.h +++ b/include/llvm/TargetTransformInfo.h @@ -157,14 +157,18 @@ class VectorTargetTransformInfo { public: virtual ~VectorTargetTransformInfo() {} + enum ShuffleKind { + Broadcast, // Broadcast element 0 to all other elements. + Reverse // Reverse the order of the vector. + }; + /// Returns the expected cost of arithmetic ops, such as mul, xor, fsub, etc. virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const { return 1; } - /// Returns the cost of a vector broadcast of a scalar at place zero to a - /// vector of type 'Tp'. - virtual unsigned getBroadcastCost(Type *Tp) const { + /// Returns the cost of a shuffle instruction of kind Kind and of type Tp. + virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp) const { return 1; } |