[PATCH] D93838: [SCCP] Add Function Specialization pass

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 04:06:28 PDT 2021


SjoerdMeijer added a comment.

In D93838#2756483 <https://reviews.llvm.org/D93838#2756483>, @fhahn wrote:

> In D93838#2756461 <https://reviews.llvm.org/D93838#2756461>, @SjoerdMeijer wrote:
>
>> My conclusion from this is that it's not just one thing: function specialisation on itself is just a minor contributor, but extra compile time is spent in existing passes without anything really standing out.
>
> Thanks for sharing the numbers!
>
> I'm not sure of the conclusion though. While function specialization itself is quick, it still is the cause of the regression in the other passes, as it (presumably) adds a lot of extra code, that the other passes now need to churn through. So this is still something that needs to be addressed in the function specialization, right?

Well, I am not entirely sure yet about that. Yes, the rest of the optimisation pipeline sees more functions/instructions, so is spending more time on that. So, from that point of view, it is what it is.
On the other hand, this could be controlled from function specialisation, by specialising less. For this example, it's really beneficial to specialise two functions. But would we for example only want to specialise 1 for compile-time? Perhaps, then we need a way to control that with a "budget" how much the code is allowed to grow, which will impact/restrict compile-times.

> re absolute numbers being small: do you have any insight into whether the impact is expected to be less on larger benchmarks/binaries?

No, not yet. Will see what I can do. It triggers for this case, but will try to find another with a larger compile time. Probably I will return to SQLite for that.


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

https://reviews.llvm.org/D93838



More information about the llvm-commits mailing list