mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:42:57 +01:00
Change the codegen Cost Model API for shuffeles. This patch removes the API for broadcast and adds a more general API that accepts an enum of known shuffles.
llvm-svn: 171022
This commit is contained in:
parent
40f2e8fde5
commit
f8f6a2ff97
@ -71,7 +71,7 @@ public:
|
||||
|
||||
virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const;
|
||||
|
||||
virtual unsigned getBroadcastCost(Type *Tp) const;
|
||||
virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp) const;
|
||||
|
||||
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
|
||||
Type *Src) const;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,8 @@ unsigned VectorTargetTransformImpl::getArithmeticInstrCost(unsigned Opcode,
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned VectorTargetTransformImpl::getBroadcastCost(Type *Tp) const {
|
||||
unsigned VectorTargetTransformImpl::getShuffleCost(ShuffleKind Kind,
|
||||
Type *Tp) const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user