#
0f9d9edd |
| 22-Jun-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Add reduction for custom register masks
I have a register allocator failure that only reproduces with IPRA enabled, and requires the specific regmask if I want to only run the one relev
llvm-reduce: Add reduction for custom register masks
I have a register allocator failure that only reproduces with IPRA enabled, and requires the specific regmask if I want to only run the one relevant pass. The printed custom regmask is enormous and I would like to reduce it.
This reduces each individual bit in the mask, but it would probably be better to start at register units and clear all aliasing fields at a time. This would require stricter verification that all aliasing bits are set in regmasks (although I would prefer to switch regmasks to use register units in the first place).
show more ...
|
#
cd434a20 |
| 17-Jul-2022 |
owenca <owenpiano@gmail.com> |
[llvm] Wrap multi-statement macro definitions with do ... while (0)
|
#
26107559 |
| 09-Jun-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Handle reducing FP values to nan
Prefer 0/1 over NaN, but it may make more sense to invert this as FP operations with nan inputs can universally be folded into something else.
|
#
2962f9df |
| 21-Jun-2022 |
John Regehr <regehr@cs.utah.edu> |
stop llvm-reduce from introducing undefs
Differential Revision: https://reviews.llvm.org/D128317
|
#
eea11e73 |
| 09-Jun-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Add reduction pass to simplify instructions
|
#
47c8ec81 |
| 22-Apr-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Add pass to remove register uses
Try to delete implicit uses, and add undef flags to explicit ones.
|
#
42c7f494 |
| 03-Jun-2022 |
Clemens Wasser <clemens.wasser@gmail.com> |
[tools] Forward declare classes & remove includes
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D120208
|
#
a0dcbe45 |
| 20-Apr-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Add reduction pass to remove regalloc hints
I'm a bit confused by what's actually stored for the allocation hints. The MIR parser only handles the "simple" case where there's a single h
llvm-reduce: Add reduction pass to remove regalloc hints
I'm a bit confused by what's actually stored for the allocation hints. The MIR parser only handles the "simple" case where there's a single hint. I don't really understand the assertion in clearSimpleHint, or under what circumstances there are multiple hint registers.
show more ...
|
#
20110521 |
| 19-Apr-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Add pass to reduce MIR instruction flags
|
#
35264e71 |
| 19-Apr-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Introduce new scoring mechanism for MIR reductions
Many MIR reductions benefit from or require increasing the instruction count. For example, unlike in the IR, you may need to insert a
llvm-reduce: Introduce new scoring mechanism for MIR reductions
Many MIR reductions benefit from or require increasing the instruction count. For example, unlike in the IR, you may need to insert a new instruction to represent an undef. The current instruction reduction pass works around this by sticking implicit defs on whatever instruction happens to be first in the entry block block.
Other strategies I've applied manually include breaking instructions with multiple defs into separate instructions, or breaking large register defs into multiple subregister defs.
Make up a simple scoring system based on what I generally try to get rid of first when manually reducing. Counts implicit defs as free since reduction passes will be introducing them, although they probably should count for something. It also might make more sense to have a comparison the two functions, rather than having to compute a contextless number. This isn't particularly well tested since overall the MIR support isn't in a place where it is useful on the kinds of testcases I want to throw at it.
show more ...
|
#
3939e99a |
| 19-Apr-2022 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
llvm-reduce: Add pass to reduce IR references from MIR
This is typically the first thing I do when reducing a new testcase until the IR section can be deleted.
|
Revision tags: llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1 |
|
#
0d36d84d |
| 02-Feb-2022 |
Markus Lavin <markus.lavin@ericsson.com> |
[llvm-reduce] Display all relevant options in -help
Previously the options category given to cl::HideUnrelatedOptions was local to llvm-reduce.cpp and as a result only options declared in that file
[llvm-reduce] Display all relevant options in -help
Previously the options category given to cl::HideUnrelatedOptions was local to llvm-reduce.cpp and as a result only options declared in that file were visible in the -help options listing. This was a bit unfortunate since there were several useful options declared in other files. This patch addresses that.
Differential Revision: https://reviews.llvm.org/D118682
show more ...
|
Revision tags: llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2 |
|
#
4eec1710 |
| 11-Jan-2022 |
John Regehr <regehr@cs.utah.edu> |
allow llvm-reduce, if asked, to run its set of passes more than once, taking longer to finish but also potentially resulting in a smaller reduced file.
|
Revision tags: llvmorg-13.0.1-rc1 |
|
#
c15f930e |
| 12-Nov-2021 |
Michael Kruse <llvm-project@meinersbur.de> |
[llvm-reduce] Introduce operands-skip pass.
Add a new "operands-skip" pass whose goal is to remove instructions in the middle of dependency chains. For instance: ``` %baseptr = alloca i32 %array
[llvm-reduce] Introduce operands-skip pass.
Add a new "operands-skip" pass whose goal is to remove instructions in the middle of dependency chains. For instance: ``` %baseptr = alloca i32 %arrayidx = getelementptr i32, i32* %baseptr, i32 %idxprom store i32 42, i32* %arrayidx ``` might be reducible to ``` %baseptr = alloca i32 %arrayidx = getelementptr ... ; now dead, together with the computation of %idxprom store i32 42, i32* %baseptr ``` Other passes would either replace `%baseptr` with undef (operands, instructions) or move it to become a function argument (operands-to-args), both of which might fail the interestingness check.
In principle the implementation allows operand replacement with any value or instruction in the function that passes the filter constraints (same type, dominance, "more reduced"), but is limited in this patch to values that are directly or indirectly used to compute the current operand value, motivated by the example above. Additionally, function arguments are added to the candidate set which helps reducing the number of relevant arguments mitigating a concern of too many arguments mentioned in https://reviews.llvm.org/D110274#3025013.
Possible future extensions: * Instead of requiring the same type, bitcast/trunc/zext could be automatically inserted for some more flexibility. * If undef is added to the candidate set, "operands-skip"is able to produce any reduction that "operands" can do. Additional candidates might be zero and one, where the "reductive power" classification can prefer one over the other. If undefined behaviour should not be introduced, undef can be removed from the candidate set.
Recommit after resolving conflict with D112651 and reusing shouldReduceOperand from D113532.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D111818
show more ...
|
#
ed7b3715 |
| 12-Nov-2021 |
Michael Kruse <llvm-project@meinersbur.de> |
Revert "[llvm-reduce] Introduce operands-skip pass."
This reverts commit fa4210a9a0729eba04593b7df7b701e2b243de39.
It causes compile failures, presumably because conflicting with another patch land
Revert "[llvm-reduce] Introduce operands-skip pass."
This reverts commit fa4210a9a0729eba04593b7df7b701e2b243de39.
It causes compile failures, presumably because conflicting with another patch landed after I checked locally.
show more ...
|
#
fa4210a9 |
| 12-Nov-2021 |
Michael Kruse <llvm-project@meinersbur.de> |
[llvm-reduce] Introduce operands-skip pass.
Add a new "operands-skip" pass whose goal is to remove instructions in the middle of dependency chains. For instance: ``` %baseptr = alloca i32 %array
[llvm-reduce] Introduce operands-skip pass.
Add a new "operands-skip" pass whose goal is to remove instructions in the middle of dependency chains. For instance: ``` %baseptr = alloca i32 %arrayidx = getelementptr i32, i32* %baseptr, i32 %idxprom store i32 42, i32* %arrayidx ``` might be reducible to ``` %baseptr = alloca i32 %arrayidx = getelementptr ... ; now dead, together with the computation of %idxprom store i32 42, i32* %baseptr ``` Other passes would either replace `%baseptr` with undef (operands, instructions) or move it to become a function argument (operands-to-args), both of which might fail the interestingness check.
In principle the implementation allows operand replacement with any value or instruction in the function that passes the filter constraints (same type, dominance, "more reduced"), but is limited in this patch to values that are directly or indirectly used to compute the current operand value, motivated by the example above. Additionally, function arguments are added to the candidate set which helps reducing the number of relevant arguments mitigating a concern of too many arguments mentioned in https://reviews.llvm.org/D110274#3025013.
Possible future extensions: * Instead of requiring the same type, bitcast/trunc/zext could be automatically inserted for some more flexibility. * If undef is added to the candidate set, "operands-skip"is able to produce any reduction that "operands" can do. Additional candidates might be zero and one, where the "reductive power" classification can prefer one over the other. If undefined behaviour should not be introduced, undef can be removed from the candidate set.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D111818
show more ...
|
#
b394ba5d |
| 09-Nov-2021 |
Arthur Eubanks <aeubanks@google.com> |
[llvm-reduce] Print extra newline when encountering unknown pass
|
#
80ba72b0 |
| 31-Oct-2021 |
Arthur Eubanks <aeubanks@google.com> |
[llvm-reduce] Reduce some GlobalObject properties
Specifically, the section and the alignment.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D112884
|
#
fd41738e |
| 02-Nov-2021 |
Markus Lavin <markus.lavin@ericsson.com> |
Recommit "[llvm-reduce] Add MIR support"
(Second try. Need to link against CodeGen and MC libs.)
The llvm-reduce tool has been extended to operate on MIR (import, clone and export). Current limitat
Recommit "[llvm-reduce] Add MIR support"
(Second try. Need to link against CodeGen and MC libs.)
The llvm-reduce tool has been extended to operate on MIR (import, clone and export). Current limitation is that only a single machine function is supported. A single reducer pass that operates on machine instructions (while on SSA-form) has been added. Additional MIR specific reducer passes can be added later as needed.
Differential Revision: https://reviews.llvm.org/D110527
show more ...
|
#
aee7f338 |
| 02-Nov-2021 |
Markus Lavin <markus.lavin@ericsson.com> |
Revert "[llvm-reduce] Add MIR support"
This reverts commit bc2773cb1bdfacfda773eb492e7b0cc65a78cda6.
Broke the clang-ppc64le-linux-multistage build. Reverting while I investigate.
|
#
bc2773cb |
| 02-Nov-2021 |
Markus Lavin <markus.lavin@ericsson.com> |
[llvm-reduce] Add MIR support
The llvm-reduce tool has been extended to operate on MIR (import, clone and export). Current limitation is that only a single machine function is supported. A single re
[llvm-reduce] Add MIR support
The llvm-reduce tool has been extended to operate on MIR (import, clone and export). Current limitation is that only a single machine function is supported. A single reducer pass that operates on machine instructions (while on SSA-form) has been added. Additional MIR specific reducer passes can be added later as needed.
Differential Revision: https://reviews.llvm.org/D110527
show more ...
|
#
96605639 |
| 13-Oct-2021 |
Arthur Eubanks <aeubanks@google.com> |
[llvm-reduce] Add reduction passes to reduce operands to undef/1/0
Having non-undef constants in a final llvm-reduce output is nicer than having undefs.
This splits the existing reduce-operands pas
[llvm-reduce] Add reduction passes to reduce operands to undef/1/0
Having non-undef constants in a final llvm-reduce output is nicer than having undefs.
This splits the existing reduce-operands pass into three, one which does the same as the current pass of reducing to undef, and two more to reduce to the constant 1 and the constant 0. Do not reduce to undef if the operand is a ConstantData, and do not reduce 0s to 1s.
Reducing GEP operands very frequently causes invalid IR (since types may not match up if we index differently into a struct), so don't touch GEPs.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D111765
show more ...
|
#
dd71b65c |
| 13-Oct-2021 |
Michael Kruse <llvm-project@meinersbur.de> |
[llvm-reduce] Introduce operands-to-args pass.
Instead of setting operands to undef as the "operands" pass does, convert the operands to a function argument. This avoids having to introduce undef va
[llvm-reduce] Introduce operands-to-args pass.
Instead of setting operands to undef as the "operands" pass does, convert the operands to a function argument. This avoids having to introduce undef values into the IR which have some unpredictability during optimizations.
For instance,
define void @func() { entry: %val = add i32 32, 21 store i32 %val, i32* null ret void }
is reduced to
define void @func(i32 %val) { entry: %val1 = add i32 32, 21 store i32 %val, i32* null ret void }
(note that the instruction %val is renamed to %val1 when printing the IR to avoid ambiguity; ideally %val1 would be removed by dce or the instruction reduction pass)
Any call to @func is replaced with a call to the function with the new signature and filled with undef. This is not ideal for IPA passes, but those out-of-scope for now.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D111503
show more ...
|
Revision tags: llvmorg-13.0.0, llvmorg-13.0.0-rc4 |
|
#
f18c0739 |
| 17-Sep-2021 |
Samuel <swamulism@gmail.com> |
[llvm-reduce] Add reduce operands pass
Add reduction to set operands to default values
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D108903
|
Revision tags: llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
#
d2e10364 |
| 23-Aug-2021 |
Arthur Eubanks <aeubanks@google.com> |
[llvm-reduce] Remove various module data
This removes the data layout, target triple, source filename, and module identifier when possible.
Reviewed By: swamulism
Differential Revision: https://re
[llvm-reduce] Remove various module data
This removes the data layout, target triple, source filename, and module identifier when possible.
Reviewed By: swamulism
Differential Revision: https://reviews.llvm.org/D108568
show more ...
|