[PATCH] D104365: [FuncSpec] Enabling specializing direct constant

Chuanqi Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 16 18:56:25 PDT 2021


ChuanqiXu added a comment.

In D104365#2821718 <https://reviews.llvm.org/D104365#2821718>, @SjoerdMeijer wrote:

>> But I guess it may be OK since we control the cost to specialize function incrementally (implemented in getSpecializationCost()). So the amount of new specialized functions wouldn't be much larger.
>
> Why would we not specialise more?  `getSpecializationCost()` just returns the cost for specialising a function. If we start doing this for functions with integer constants, I don't see why we could not start specialising more. But will double check if I missed anything.
>
> I still think some fine gain control what to specialise will be convenient (for testing/experimenting). I will add an option for function pointers and globals.

Since the cost of specializing a function would be multiplied by a penalty, which is the number of function specialized. So within the process of function specialized, the penalty would be larger and larger. So the number of new specialized functions wouldn't much more. It should be convergent.


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

https://reviews.llvm.org/D104365



More information about the llvm-commits mailing list