|
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 |
|
| #
ebc54e0c |
| 14-Jul-2022 |
Nikita Popov <[email protected]> |
[SCCP] Make check for unknown/undef in unary op handling more explicit (NFCI)
Make the implementation more similar to other functions, by explicitly skipping an unknown/undef first, and always falli
[SCCP] Make check for unknown/undef in unary op handling more explicit (NFCI)
Make the implementation more similar to other functions, by explicitly skipping an unknown/undef first, and always falling back to overdefined at the end. I don't think it makes a difference now, but could make one once the constant evaluation can fail. In that case we would directly mark the result as overdefined now, rather than keeping it unknown (and later making it overdefined because we think it's undef-based).
show more ...
|
|
Revision tags: llvmorg-14.0.6 |
|
| #
6db3edc8 |
| 22-Jun-2022 |
Nikita Popov <[email protected]> |
[SCCP] Don't check for UndefValue before calling markConstant()
The value lattice explicitly represents undef, and markConstant() internally checks for UndefValue and will create an undef rather tha
[SCCP] Don't check for UndefValue before calling markConstant()
The value lattice explicitly represents undef, and markConstant() internally checks for UndefValue and will create an undef rather than constant lattice element in that case.
This is mostly a code simplification, it has little practical impact because we usually get undef results from undef operands, and those don't get processed.
Only leave the check behind for the CmpInst case, because it currently goes through this incorrect code in the getCompare() implementation: https://github.com/llvm/llvm-project/blob/f98697642cea761448dc0f84f750d3f5def8af6b/llvm/include/llvm/Analysis/ValueLattice.h#L456-L457
Differential Revision: https://reviews.llvm.org/D128330
show more ...
|
| #
07146a9e |
| 13-Jul-2022 |
Nikita Popov <[email protected]> |
[SCCP] Fix typo in previous commit
Ooops, I tested a build from the wrong checkout.
|
| #
e298dfbc |
| 13-Jul-2022 |
Nikita Popov <[email protected]> |
[SCCP] Avoid ConstantExpr::get() call
Use ConstantFoldUnaryOpOperand() API instead. This is in preparation for removing fneg constant expressions.
|
| #
9b994593 |
| 21-Jun-2022 |
Nikita Popov <[email protected]> |
[SCCP] Only handle unknown lattice values in resolvedUndefsIn()
This is a minor refinement of resolvedUndefsIn(), mostly for clarity. If the value of an instruction is undef, then that's already a l
[SCCP] Only handle unknown lattice values in resolvedUndefsIn()
This is a minor refinement of resolvedUndefsIn(), mostly for clarity. If the value of an instruction is undef, then that's already a legal final result -- we can safely rauw such an instruction with undef. We only need to mark unknown values as overdefined, as that's the result we get for an instruction that has not been processed because it has an undef operand.
Differential Revision: https://reviews.llvm.org/D128251
show more ...
|
|
Revision tags: llvmorg-14.0.5 |
|
| #
1f88d804 |
| 03-Jun-2022 |
Nikita Popov <[email protected]> |
[SCCP] Don't mark edges feasible when resolving undefs
As branch on undef is immediate undefined behavior, there is no need to mark one of the edges as feasible. We can leave all the edges non-feasi
[SCCP] Don't mark edges feasible when resolving undefs
As branch on undef is immediate undefined behavior, there is no need to mark one of the edges as feasible. We can leave all the edges non-feasible. In IPSCCP, we can replace the branch with an unreachable terminator.
Differential Revision: https://reviews.llvm.org/D126962
show more ...
|
| #
b8c2781f |
| 09-Jun-2022 |
Simon Moll <[email protected]> |
[NFC] format InstructionSimplify & lowerCaseFunctionNames
Clang-format InstructionSimplify and convert all "FunctionName"s to "functionName". This patch does touch a lot of files but gets done with
[NFC] format InstructionSimplify & lowerCaseFunctionNames
Clang-format InstructionSimplify and convert all "FunctionName"s to "functionName". This patch does touch a lot of files but gets done with the cleanup of InstructionSimplify in one commit.
This is the alternative to the less invasive clang-format only patch: D126783
Reviewed By: spatel, rengolin
Differential Revision: https://reviews.llvm.org/D126889
show more ...
|
| #
7fa97b47 |
| 30-May-2022 |
Nikita Popov <[email protected]> |
[SCCP] Don't mark ranges from branch conditions as potentially undef
Now that transforms introducing branch on poison have been removed, we can stop marking ranges that have been derived from branch
[SCCP] Don't mark ranges from branch conditions as potentially undef
Now that transforms introducing branch on poison have been removed, we can stop marking ranges that have been derived from branch conditions as containing undef. The existing comment explains why this is legal. I've checked that alive2 is happy with SCCP tests after this change.
Differential Revision: https://reviews.llvm.org/D126647
show more ...
|
|
Revision tags: llvmorg-14.0.4, llvmorg-14.0.3 |
|
| #
a910337b |
| 27-Apr-2022 |
Alexandros Lamprineas <[email protected]> |
[FuncSpec] Conditional jump or move depends on uninitialised value(s).
I found this bug when performing a two-stage build of clang with Function Specialization enabled and tuned aggressively. The cr
[FuncSpec] Conditional jump or move depends on uninitialised value(s).
I found this bug when performing a two-stage build of clang with Function Specialization enabled and tuned aggressively. The crash appears only on release builds.
Fixes https://github.com/llvm/llvm-project/issues/55000.
Before accessing the contents of the ArgInfo iterator inside SCCPInstVisitor::markArgInFuncSpecialization, we should be checking that the iterator is valid.
Differential Revision: https://reviews.llvm.org/D124114
show more ...
|
|
Revision tags: 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 |
|
| #
910eb988 |
| 03-Mar-2022 |
Alexandros Lamprineas <[email protected]> |
[FuncSpec][NFC] Refactor internal structures.
`ArgInfo` is reduced to only contain a pair of {formal,actual} values. The specialized function `Fn` and the `Partial` flag are redundant in this struct
[FuncSpec][NFC] Refactor internal structures.
`ArgInfo` is reduced to only contain a pair of {formal,actual} values. The specialized function `Fn` and the `Partial` flag are redundant in this structure. The `Gain` is moved to a new struct `SpecializationInfo`.
The value mappings created by cloneCandidateFunction() are being used by rewriteCallSites() for matching the formal arguments of recursive functions.
The list of specializations is passed by reference to calculateGains() instead of being returned by value.
The `IsPartial` flag is removed from isArgumentInteresting() and getPossibleConstants() as it's no longer used anywhere in the code.
Differential Revision: https://reviews.llvm.org/D120753
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc2 |
|
| #
a494ae43 |
| 01-Mar-2022 |
serge-sans-paille <[email protected]> |
Cleanup includes: TransformsUtils
Estimation on the impact on preprocessor output: before: 1065307662 after: 1064800684
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-
Cleanup includes: TransformsUtils
Estimation on the impact on preprocessor output: before: 1065307662 after: 1064800684
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup Differential Revision: https://reviews.llvm.org/D120741
show more ...
|
| #
b803aee6 |
| 01-Mar-2022 |
Alexandros Lamprineas <[email protected]> |
[FuncSpec][NFC] Improve debug messages.
Adds diagnostic messages when debugging the pass.
Differential Revision: https://reviews.llvm.org/D119875
|
| #
7b74123a |
| 15-Feb-2022 |
Alexandros Lamprineas <[email protected]> |
[FuncSpec][NFC] Variable renaming.
Just preparing the ground for follow up patches to make the reviews easier.
Differential Revision: https://reviews.llvm.org/D119874
|
|
Revision tags: llvmorg-14.0.0-rc1 |
|
| #
3a3cb929 |
| 07-Feb-2022 |
Kazu Hirata <[email protected]> |
[llvm] Use = default (NFC)
|
|
Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
| #
098e9351 |
| 14-Nov-2021 |
Kazu Hirata <[email protected]> |
[llvm] Use range-based for loops with CallBase::args (NFC)
|
| #
ce4fa93d |
| 24-Oct-2021 |
Anton Afanasyev <[email protected]> |
[SCCP] Tune cast instruction handling for overdefined operand
Extended value is known to be inside range smaller than full one. Prevent SCCP to mark such value as overdefined.
Fixes PR52253
Differ
[SCCP] Tune cast instruction handling for overdefined operand
Extended value is known to be inside range smaller than full one. Prevent SCCP to mark such value as overdefined.
Fixes PR52253
Differential Revision: https://reviews.llvm.org/D112721
show more ...
|
| #
cdfc6785 |
| 05-Oct-2021 |
Sjoerd Meijer <[email protected]> |
[SCCPSolver] Fix use-after-free in markArgInFuncSpecialization
In SCCPSolver::markArgInFuncSpecialization, the ValueState map may be reallocated *after* the initial ValueLatticeElement reference is
[SCCPSolver] Fix use-after-free in markArgInFuncSpecialization
In SCCPSolver::markArgInFuncSpecialization, the ValueState map may be reallocated *after* the initial ValueLatticeElement reference is grabbed, but *before* its use in copy initialization. This causes a use-after-free. To fix this, this commit changes the behavior to create the new ValueLatticeElement before assigning the old one to it.
Patch by: https://github.com/duck-37/
Differential Revision: https://reviews.llvm.org/D111112
show more ...
|
|
Revision tags: 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, 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 ...
|
| #
39d29817 |
| 14-Apr-2021 |
Sjoerd Meijer <[email protected]> |
[SCCP] Follow up of rGbbab9f986c6d. NFC.
This addresses the linter messages, mainly the inconsistent capitalisation of member functions.
|
| #
bbab9f98 |
| 12-Apr-2021 |
Sjoerd Meijer <[email protected]> |
[SCCP] Create SCCP Solver
This refactors SCCP and creates a SCCPSolver interface and class so that it can be used by other passes and transformations. We will use this in D93838, which adds a functi
[SCCP] Create SCCP Solver
This refactors SCCP and creates a SCCPSolver interface and class so that it can be used by other passes and transformations. We will use this in D93838, which adds a function specialisation pass.
This is based on an early version by Vinay Madhusudan.
Differential Revision: https://reviews.llvm.org/D93762
show more ...
|