[PATCH] D136180: [FuncSpec] Compute specialisation gain even when forcing specialisation

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 06:34:00 PDT 2022


chill added a comment.

In D136180#3868139 <https://reviews.llvm.org/D136180#3868139>, @labrinea wrote:

> Ideally the ordering in which the specializations appear should have nothing to do with how we decide to match them with the callsites. However, it looks like the ordering does matter as far as `rewriteCallSites()` is concerned. Your suggestion to use the cost model to address this issue seems to work, but we need to come up with a better way of associating specializations with callsites. That said I am ok with the change as an intermediate solution.

Well, we may change the way call sites and specialisations are matched. I have an alternative design for this, which explicitly maintains an association between a specialisation and the call sites used to generate it (which means it's the best specialisation for these call sites).

But as long as we have the current algorithm and data structures, IMHO the approach with comparing gain in fact works, not just "appear to work", as explained by my comment above.

Do you see any fault in the reasoning there?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136180/new/

https://reviews.llvm.org/D136180



More information about the llvm-commits mailing list