diff options
author | Hongyu Wang <hongyu.wang@intel.com> | 2024-02-07 14:42:58 +0800 |
---|---|---|
committer | Hongyu Wang <hongyu.wang@intel.com> | 2024-07-04 11:11:11 +0800 |
commit | 8e72b1bb3896f6e8d4f4679cbcfbc2a8212d04f9 (patch) | |
tree | d66c8badcc16052dcb35bbb89dae3580a2d09f7f /gcc/gimplify.cc | |
parent | baac8f710e35cfea14060e5eca49dbb49ffc294d (diff) | |
download | gcc-8e72b1bb3896f6e8d4f4679cbcfbc2a8212d04f9.zip gcc-8e72b1bb3896f6e8d4f4679cbcfbc2a8212d04f9.tar.gz gcc-8e72b1bb3896f6e8d4f4679cbcfbc2a8212d04f9.tar.bz2 |
[APX PPX] Avoid generating unmatched pushp/popp in pro/epilogue
According to APX spec, the pushp/popp pairs should be matched,
otherwise the PPX hint cannot take effect and cause performance loss.
In the ix86_expand_epilogue, there are several optimizations that may
cause the epilogue using mov to restore the regs. Check if PPX applied
and prevent usage of mov/leave in the epilogue. Also do not use PPX
for eh_return.
gcc/ChangeLog:
* config/i386/i386.cc (ix86_expand_prologue): Set apx_ppx_used
flag in m.fs with TARGET_APX_PPX && !crtl->calls_eh_return.
(ix86_emit_save_regs): Emit ppx is available only when
TARGET_APX_PPX && !crtl->calls_eh_return.
(ix86_expand_epilogue): Don't restore reg using mov when
apx_ppx_used flag is true.
* config/i386/i386.h (struct machine_frame_state):
Add apx_ppx_used flag.
gcc/testsuite/ChangeLog:
* gcc.target/i386/apx-ppx-2.c: New test.
* gcc.target/i386/apx-ppx-3.c: Likewise.
Diffstat (limited to 'gcc/gimplify.cc')
0 files changed, 0 insertions, 0 deletions