[llvm] [TTI] Simplify implementation (NFCI) (PR #136674)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 22 10:28:17 PDT 2025
davemgreen wrote:
> I don't expect any compile-time regressions/improvements here (there is still one virtual call).
I have often thought that the cost model dance is more difficult than helpful and thought recently of simplifying it. Does this mean that all calls between functions like AArch64TTIImpl::getIntrinsicInstrCost and functions in BasicTTIImplBase<AArch64TTIImpl> now go through a virtual dispatch, so need a vtable lookup and cannot be inlined and whatnot? Same for calls from BasicTTIImplBase<AArch64TTIImpl> -> AArch64TTIImpl methods or even AArch64TTIImpl -> AArch64TTIImpl. (Some of those directions might be helped by final, if that does anything useful).
That had been my guess for the reason, that you pay one virtual call to get into the getIntrinsicInstrCost functions, but none to calls once you were inside AArch64TTIImpl and the base classes. Honestly it might be worth removing if we don't see much benefit from it, but it would be nice if the cost model was efficient (to allow us to do other things with it). It might be worth checking, and maybe marking more of the target TTI implementations as final.
https://github.com/llvm/llvm-project/pull/136674
More information about the llvm-commits
mailing list