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

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 09:08:42 PST 2021


SjoerdMeijer added a comment.

I have also become interested in this work as this regularly shows up as difference between clang and gcc. For the first attempt to add a function specialisation pass in D36432 <https://reviews.llvm.org/D36432> very rightfully questions were asked about compile-times and code-size, and these questions were repeated for this work. The table https://reviews.llvm.org/D36432#836883 shows good numbers, and I think in order to progress this work we need something similar. I.e. the approach here is a bit different and things may have changed. But this is also mentioned in the description:

> The pass is still missing the profitability.

and

> I am yet to do the complete SPEC run and measure the speed /size change.

I agree with @fhahn and others that this will be most useful if it gets enabled by default.

> Inline cost model works for the function pointer like arguments. We are specializing other type arguments as well. I have a patch ready for proposal but waiting for D93762 <https://reviews.llvm.org/D93762> to be checked-in first..

My impression is that this is not the right order of events. To address concerns about regressions, we first need to get some data on the table first I guess. Then, ideas can be developed to get it enabled by default. If that path looks credible, I am sure we get D93762 <https://reviews.llvm.org/D93762> approved/committed in no time. D93762 <https://reviews.llvm.org/D93762> is thus not going to be blocker here.

And what should support this work, is that GCC has this enabled from -O3 and up, thus showing that this should be possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93838



More information about the llvm-commits mailing list