|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1 |
|
| #
8045bf9d |
| 23-Mar-2022 |
Alexandros Lamprineas <[email protected]> |
[FuncSpec] Support function specialization across multiple arguments.
The current implementation of Function Specialization does not allow specializing more than one arguments per function call, whi
[FuncSpec] Support function specialization across multiple arguments.
The current implementation of Function Specialization does not allow specializing more than one arguments per function call, which is a limitation I am lifting with this patch.
My main challenge was to choose the most suitable ADT for storing the specializations. We need an associative container for binding all the actual arguments of a specialization to the function call. We also need a consistent iteration order across executions. Lastly we want to be able to sort the entries by Gain and reject the least profitable ones.
MapVector fits the bill but not quite; erasing elements is expensive and using stable_sort messes up the indices to the underlying vector. I am therefore using the underlying vector directly after calculating the Gain.
Differential Revision: https://reviews.llvm.org/D119880
show more ...
|
|
Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
| #
33830326 |
| 01-Mar-2022 |
Alexandros Lamprineas <[email protected]> |
[FuncSpec] Remove definitions of fully specialized functions.
A function is basically dead when: * it has no uses * it has only self-referencing uses (it's recursive)
Differential Revision: https
[FuncSpec] Remove definitions of fully specialized functions.
A function is basically dead when: * it has no uses * it has only self-referencing uses (it's recursive)
Differential Revision: https://reviews.llvm.org/D119878
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
| #
9e3ae8d2 |
| 21-Dec-2021 |
Sjoerd Meijer <[email protected]> |
[FuncSpec] Rename internal option. NFC.
Rename option MaxConstantsThreshold to MaxClonesThreshold. Not only is this more descriptive, this is also in preparation of introducing another threshold to
[FuncSpec] Rename internal option. NFC.
Rename option MaxConstantsThreshold to MaxClonesThreshold. Not only is this more descriptive, this is also in preparation of introducing another threshold to analyse more than just 1 constant argument as we currently do, and to better distinguish these options/thresholds.
show more ...
|
| #
78a392cf |
| 17-Dec-2021 |
Sjoerd Meijer <[email protected]> |
[FuncSpec] Respect MaxConstantsThreshold
This is a follow up of D115458 and truncates the worklist of actual arguments that can be specialised to 'MaxConstantsThreshold' candidates if MaxConstantsTh
[FuncSpec] Respect MaxConstantsThreshold
This is a follow up of D115458 and truncates the worklist of actual arguments that can be specialised to 'MaxConstantsThreshold' candidates if MaxConstantsThreshold was exceeded. Thus, this changes the behaviour of option -func-specialization-max-constants. Before it didn't specialise at all when this threshold was exceeded, but now it specialises up to MaxConstantsThreshold candidates from the sorted worklist.
Differential Revision: https://reviews.llvm.org/D115509
show more ...
|
|
Revision tags: llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3 |
|
| #
f8aaec19 |
| 25-Jun-2021 |
Nikita Popov <[email protected]> |
[OpaquePtr] Support forward references in textual IR
Currently, LLParser will create a Function/GlobalVariable forward reference based on the desired pointer type and then modify it when it is decla
[OpaquePtr] Support forward references in textual IR
Currently, LLParser will create a Function/GlobalVariable forward reference based on the desired pointer type and then modify it when it is declared. With opaque pointers, we generally do not know the correct type to use until we see the declaration.
Solve this by creating the forward reference with a dummy type, and then performing a RAUW with the correct Function/GlobalVariable when it is declared. The approach is adopted from https://github.com/TNorthover/llvm-project/commit/b5b55963f62038319fa7a8b1b232226ba1d8ef3c.
This results in a change to the use list order, which is why we see test changes on some module passes that are not stable under use list reordering.
Differential Revision: https://reviews.llvm.org/D104950
show more ...
|
|
Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
| #
c4a0969b |
| 04-May-2021 |
Sjoerd Meijer <[email protected]> |
Function Specialization Pass
This adds a function specialization pass to LLVM. Constant parameters like function pointers and constant globals are propagated to the callee by specializing the functi
Function Specialization Pass
This adds a function specialization pass to LLVM. Constant parameters like function pointers and constant globals are propagated to the callee by specializing the function.
This is a first version with a number of limitations: - The pass is off by default, so needs to be enabled on the command line, - It does not handle specialization of recursive functions, - It does not yet handle constants and constant ranges, - Only 1 argument per function is specialised, - The cost-model could be further looked into, and perhaps related, - We are not yet caching analysis results.
This is based on earlier work by Matthew Simpson (D36432) and Vinay Madhusudan. More recently this was also discussed on the list, see:
https://lists.llvm.org/pipermail/llvm-dev/2021-March/149380.html.
The motivation for this work is that function specialisation often comes up as a reason for performance differences of generated code between LLVM and GCC, which has this enabled by default from optimisation level -O3 and up. And while this certainly helps a few cpu benchmark cases, this also triggers in real world codes and is thus a generally useful transformation to have in LLVM.
Function specialisation has great potential to increase compile-times and code-size. The summary from some investigations with this patch is: - Compile-time increases for short compile jobs is high relatively, but the increase in absolute numbers still low. - For longer compile-jobs, the extra compile time is around 1%, and very much in line with GCC. - It is difficult to blame one thing for compile-time increases: it looks like everywhere a little bit more time is spent processing more functions and instructions. - But the function specialisation pass itself is not very expensive; it doesn't show up very high in the profile of the optimisation passes.
The goal of this work is to reach parity with GCC which means that eventually we would like to get this enabled by default. But first we would like to address some of the limitations before that.
Differential Revision: https://reviews.llvm.org/D93838
show more ...
|