[PATCH] D106426: [FuncSpec] Support specialising recursive functions

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 00:01:54 PDT 2021


SjoerdMeijer added a comment.

In D106426#2898903 <https://reviews.llvm.org/D106426#2898903>, @ChuanqiXu wrote:

>> Or perhaps we do need a "aggressive" options, that sets the number of iterations to some value.
>
> This is the problem. Since the number of recursive function get specialized may increase with `FuncSpecializationMaxIters`, it may be scaring to users (may be other compiler engineer tuning the performance). I think the problem may come from there is no restriction between iterations.
> One solution may be add  a structure like `Set<Set<Function*>>` to record functions specialized and a structure `Set<Function*, Argument*>` to record the function specialized for specific argument. Then we could give higher penalty for the recursive cases for the same argument. The design for data structure may not be best. But I think I stated my concern. Simply, I don't want the number of specialized functions get increased linearly with `FuncSpecializationMaxIters` increases unlimitedly.

I am happy to look into that. Shall we do that as a follow up? This gives us the baseline that we can experiment with and get numbers for, then see if we can improve that.


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

https://reviews.llvm.org/D106426



More information about the llvm-commits mailing list