Skip to content

Commit ed1fbd8

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. #147677 aims to fix part of this.
1 parent 5503a8a commit ed1fbd8

File tree

2 files changed

+113
-108
lines changed

2 files changed

+113
-108
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

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

17881788
std::optional<Intrinsic::ID> FID =
17891789
VPIntrinsic::getFunctionalIntrinsicIDForVP(ICA.getID());
1790+
1791+
// Not functionally equivalent but close enough for cost modelling.
1792+
if (ICA.getID() == Intrinsic::experimental_vp_reverse)
1793+
FID = Intrinsic::vector_reverse;
1794+
17901795
if (FID) {
17911796
// Non-vp version will have same arg types except mask and vector
17921797
// length.

0 commit comments

Comments
 (0)