Skip to content

Commit a7563b0

Browse files
committed
[TTI] Handle experimental.vp.reverse in BasicTTIImpl
A experimental_vp_reverse isn't exactly functionally the same as vector_reverse, so previously it wasn't getting picked up by the generic VP costing code that reuses the non-VP equivalents. But for costing purposes it's good enough so we can reuse it. The RISC-V costs are still incorrect and are showing up as scalarized. llvm#147677 aims to fix part of this.
1 parent f539ba4 commit a7563b0

File tree

2 files changed

+79
-149
lines changed

2 files changed

+79
-149
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,6 +1775,11 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
17751775

17761776
std::optional<Intrinsic::ID> FID =
17771777
VPIntrinsic::getFunctionalIntrinsicIDForVP(ICA.getID());
1778+
1779+
// Not functionally equivalent but close enough for cost modelling.
1780+
if (ICA.getID() == Intrinsic::experimental_vp_reverse)
1781+
FID = Intrinsic::vector_reverse;
1782+
17781783
if (FID) {
17791784
// Non-vp version will have same arg types except mask and vector
17801785
// length.

0 commit comments

Comments
 (0)