diff options
author | Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> | 2024-06-19 11:55:57 +0900 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2024-06-19 01:21:11 -0700 |
commit | 23141088e8fb50bf916ac0b2e364b1eef9f3569d (patch) | |
tree | 9b3b01183cd8001e9edae9835765571aeb28e645 /gcc/fortran | |
parent | eb549f13fcde079a7bbe27e5ba3d5e80abbffba1 (diff) | |
download | gcc-23141088e8fb50bf916ac0b2e364b1eef9f3569d.zip gcc-23141088e8fb50bf916ac0b2e364b1eef9f3569d.tar.gz gcc-23141088e8fb50bf916ac0b2e364b1eef9f3569d.tar.bz2 |
xtensa: constantsynth: Reforge to fix some non-fatal issues
The previous constant synthesis logic had some issues that were non-fatal
but worth considering:
- It didn't work with DFmode literals, because those were cast to SImode
rather SFmode when splitting into two natural-width words by
split_double().
- It didn't work with large literals when TARGET_AUTO_LITPOOLS was enabled,
because those were relaxed MOVI immediates rather references to literal
pool entries,
- It didn't take into account that when literals with the same RTL
representation are pooled multiple times within a function, those entries
are shared (especially important when optimizing for size).
This patch addresses the above issues by making appropriate tweaks to the
constant synthesis logic.
gcc/ChangeLog:
* config/xtensa/xtensa-protos.h (xtensa_constantsynth):
Change the second argument from HOST_WIDE_INT to rtx.
* config/xtensa/xtensa.cc (#include):
Add "context.h" and "pass_manager.h".
(machine_function): Add a new hash_map field "litpool_usage".
(xtensa_constantsynth): Make "src" (the second operand) accept
RTX literal instead of its value, and treat both bare and pooled
SI/SFmode literals equally by bit-exact canonicalization into
CONST_INT RTX internally. And then, make avoid synthesis if
such multiple identical canonicalized literals are found in same
function when optimizing for size. Finally, for literals where
synthesis is not possible or has been avoided, re-emit "move"
RTXes with canonicalized ones to increase the chances of sharing
literal pool entries.
* config/xtensa/xtensa.md (split patterns for constant synthesis):
Change to simply invoke xtensa_constantsynth() as mentioned above,
and add new patterns for when TARGET_AUTO_LITPOOLS is enabled.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions