forked from OSchip/llvm-project
[TargetLowering] Remove isDesirableToCombineBuildVectorToShuffleTruncate target hook. NFC.
This hasn't been used for years, its original implementation, D35700, had bugs that caused the reversion of most of the code, and since then x86 shuffle lowering/combining has handled most cases and can deal with the rest as well.
This commit is contained in:
parent
6589a29147
commit
4229f12a22
|
@ -3428,20 +3428,6 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
// Return true if it is profitable to combine a BUILD_VECTOR with a stride-pattern
|
||||
// to a shuffle and a truncate.
|
||||
// Example of such a combine:
|
||||
// v4i32 build_vector((extract_elt V, 1),
|
||||
// (extract_elt V, 3),
|
||||
// (extract_elt V, 5),
|
||||
// (extract_elt V, 7))
|
||||
// -->
|
||||
// v4i32 truncate (bitcast (shuffle<1,u,3,u,5,u,7,u> V, u) to v4i64)
|
||||
virtual bool isDesirableToCombineBuildVectorToShuffleTruncate(
|
||||
ArrayRef<int> ShuffleMask, EVT SrcVT, EVT TruncVT) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Return true if the target has native support for the specified value type
|
||||
/// and it is 'desirable' to use the type for the given node type. e.g. On x86
|
||||
/// i16 is legal, but undesirable since i16 instruction encodings are longer
|
||||
|
|
|
@ -46538,27 +46538,6 @@ bool X86TargetLowering::IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool X86TargetLowering::
|
||||
isDesirableToCombineBuildVectorToShuffleTruncate(
|
||||
ArrayRef<int> ShuffleMask, EVT SrcVT, EVT TruncVT) const {
|
||||
|
||||
assert(SrcVT.getVectorNumElements() == ShuffleMask.size() &&
|
||||
"Element count mismatch");
|
||||
assert(
|
||||
Subtarget.getTargetLowering()->isShuffleMaskLegal(ShuffleMask, SrcVT) &&
|
||||
"Shuffle Mask expected to be legal");
|
||||
|
||||
// For 32-bit elements VPERMD is better than shuffle+truncate.
|
||||
// TODO: After we improve lowerBuildVector, add execption for VPERMW.
|
||||
if (SrcVT.getScalarSizeInBits() == 32 || !Subtarget.hasAVX2())
|
||||
return false;
|
||||
|
||||
if (is128BitLaneCrossingShuffleMask(SrcVT.getSimpleVT(), ShuffleMask))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// X86 Inline Assembly Support
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
|
|
@ -789,19 +789,6 @@ namespace llvm {
|
|||
|
||||
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
|
||||
|
||||
// Return true if it is profitable to combine a BUILD_VECTOR with a
|
||||
// stride-pattern to a shuffle and a truncate.
|
||||
// Example of such a combine:
|
||||
// v4i32 build_vector((extract_elt V, 1),
|
||||
// (extract_elt V, 3),
|
||||
// (extract_elt V, 5),
|
||||
// (extract_elt V, 7))
|
||||
// -->
|
||||
// v4i32 truncate (bitcast (shuffle<1,u,3,u,4,u,5,u,6,u,7,u> V, u) to
|
||||
// v4i64)
|
||||
bool isDesirableToCombineBuildVectorToShuffleTruncate(
|
||||
ArrayRef<int> ShuffleMask, EVT SrcVT, EVT TruncVT) const override;
|
||||
|
||||
/// Return true if the target has native support for
|
||||
/// the specified value type and it is 'desirable' to use the type for the
|
||||
/// given node type. e.g. On x86 i16 is legal, but undesirable since i16
|
||||
|
|
Loading…
Reference in New Issue