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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 08:03:15 PST 2021


fhahn added a comment.

In D93838#2527276 <https://reviews.llvm.org/D93838#2527276>, @mivnay wrote:

> In D93838#2525167 <https://reviews.llvm.org/D93838#2525167>, @sanwou01 wrote:
>
>> Hi @mivnay,
>>
>> As the approach here is pretty much identical to D36432 <https://reviews.llvm.org/D36432>, do you have any plans on the cost model for this pass? The earlier proposal seems to have been abandoned due to a lack of good heuristics to trade off between the (potentially huge) increase in code size (as well as compile time) and performance improvements (which may or may not arise due to later optimizations). Perhaps it would help to look at what trade-offs GCC makes? Specifically, it would be good to have an idea of how you would implement getSpecializationCost and getSpecializationBonus.
>>
>> To help with review, could you make sure this patch is based on top of D93762 <https://reviews.llvm.org/D93762> so that those changes don't appear here again?
>>
>> Thanks!
>
> Hi,
>
> Thanks for looking into the patch. I have uploaded this patch just as a reference for the review D93762 <https://reviews.llvm.org/D93762>.  The pass is not complete and might have issues.  As you mentioned, the code is identical to D36432 <https://reviews.llvm.org/D36432> but we are trying to add a new pass (which can be invoked optionally) instead of tight integration with the SCCP functions. We are trying to utilize the `SCCPSolver` by moving it to the header file. Can you please look at D393762 <https://reviews.llvm.org/D93762>?

IICU the review for D393762 raised some issues with the approach and also has comments with a few alternatives that may be viable to explore instead of function specialization? I am a bit reluctant to add a pass without a clear path towards enabling without causing regressions in general, especially when there are potential alternatives that may not suffer from the same problem.


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