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
virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const;
virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
virtual unsigned getArithmeticInstrCost(unsigned Opcode, Type *Ty) const;
virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
+ int Index, Type *SubTp) const;
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
Type *Src) const;
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
Type *Src) const;
}
/// Returns the cost of a shuffle instruction of kind Kind and of type Tp.
}
/// 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,
virtual unsigned getShuffleCost(ShuffleKind Kind, Type *Tp,
+ int Index = 0, Type *SubTp = 0) const {
}
unsigned VectorTargetTransformImpl::getShuffleCost(ShuffleKind Kind,
}
unsigned VectorTargetTransformImpl::getShuffleCost(ShuffleKind Kind,
- Type *Tp,
- int Index) const {
+ Type *Tp, int Index, Type *SubTp) const {
unsigned X86VectorTargetTransformInfo::getShuffleCost(ShuffleKind Kind, Type *Tp,
unsigned X86VectorTargetTransformInfo::getShuffleCost(ShuffleKind Kind, Type *Tp,
+ int Index,
+ Type *SubTp) const {
// We only estimate the cost of reverse shuffles.
if (Kind != Reverse)
// 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;
std::pair<unsigned, MVT> LT = getTypeLegalizationCost(Tp);
unsigned Cost = 1;
virtual unsigned getCastInstrCost(unsigned Opcode, Type *Dst,
Type *Src) const;
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;