diff options
author | Pavel Samolysov <samolisov@gmail.com> | 2022-05-04 11:38:21 +0300 |
---|---|---|
committer | Pavel Samolysov <samolisov@gmail.com> | 2022-06-28 15:19:58 +0300 |
commit | 170c4d21bd94d4f183c2fec1dd7d261360df7bae (patch) | |
tree | d847781f09109e7052054cd44afe82ee01c25017 /llvm/lib/CodeGen/DFAPacketizer.cpp | |
parent | 508eb41d82ca956c30950d9a16b522a29aeeb333 (diff) | |
download | llvm-170c4d21bd94d4f183c2fec1dd7d261360df7bae.zip llvm-170c4d21bd94d4f183c2fec1dd7d261360df7bae.tar.gz llvm-170c4d21bd94d4f183c2fec1dd7d261360df7bae.tar.bz2 |
[ArgPromotion] Unify byval promotion with non-byval
It makes sense to handle byval promotion in the same way as non-byval
but also allowing `store` instructions. However, these should
use the same checks as the `load` instructions do, i.e. be part of the
`ArgsToPromote` collection. For these instructions, the check for
interfering modifications can be disabled, though. The promotion
algorithm itself has been modified a lot: all the accesses (i.e. loads
and stores) are rewritten to the emitted `alloca` instructions. To
optimize these new `alloca`s out, the `PromoteMemToReg` function from
`Transforms/Utils/PromoteMemoryToRegister.cpp` file is invoked after
promotion.
In order to let the `PromoteMemToReg` promote as many `alloca`s as it
is possible, there should be no `GEP`s from the `alloca`s. To
eliminate the `GEP`s, its own `alloca` is generated for every argument
part because a single `alloca` for the whole argument (that
significantly simplifies the code of the pass though) unfortunately
cannot be used.
The idea comes from the following discussion:
https://reviews.llvm.org/D124514#3479676
Differential Revision: https://reviews.llvm.org/D125485
Diffstat (limited to 'llvm/lib/CodeGen/DFAPacketizer.cpp')
0 files changed, 0 insertions, 0 deletions