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

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 00:02:21 PDT 2021


ChuanqiXu added a comment.

In D93838#2758650 <https://reviews.llvm.org/D93838#2758650>, @xbolva00 wrote:

>>> I think we could limit the numbers of function specialized.
>
> Yes, and we should some score which says how profitable specialization could be - so we can prioritize such specializations.

Yeah, it should be. It further requires us to split the current pass into an analysis one and a transformed

In D93838#2758878 <https://reviews.llvm.org/D93838#2758878>, @SjoerdMeijer wrote:

> Let's discuss a way forward with this.
>
> Data and analysis has shown that regarding increased compile-times:
>
> - there there is not one single pass to blame (if that were the case, there could perhaps have been an easy fix);
> - the obvious way to control this, is to specialise less, based on a cost-model that also takes function size into account, which looks fairly straightforward to plumb in to me as a first step,
> - and compile-times is not a disaster at the moment! The overhead will be bigger perhaps with shorter compile times, and less visible with larger. Also, it currently is in line with GCC, which has this enabled by default.
>
> I would like to propose this as an initial version so that we can get more experience with this, and also very importantly, others can contribute and help with this.
>
> then, as a follow up my plan is now to:
>
> - look at code-size grow and control it,
> - and study and document GCC's cost-model.
>
> Agreed @fhahn , @xbolva00 , @ChuanqiXu , @sanwou01 ?



> - the obvious way to control this, is to specialise less, based on a cost-model that also takes function size into account, which looks fairly straightforward to plumb in to me as a first step,

I think the current cost model already consider the size of the function.

> I would like to propose this as an initial version so that we can get more experience with this, and also very importantly, others can contribute and help with this.

Yeah, the current patch looks good to me with some problems remaining. And after this patch accepted, I think I would try to enable it in ThinLTO like I discussed in (https://groups.google.com/g/llvm-dev/c/rXb0Zl7OKB4). I think function specialization pass is potential.
Of course, as a freshman to this community, I am not familiar with the standard about accepting a new pass. Let's see the opinions from the experienced guys : )


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

https://reviews.llvm.org/D93838



More information about the llvm-commits mailing list