-
- Downloads
[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.
Showing
- gcc/config/i386/i386.cc 9 additions, 4 deletionsgcc/config/i386/i386.cc
- gcc/config/i386/i386.h 4 additions, 0 deletionsgcc/config/i386/i386.h
- gcc/testsuite/gcc.target/i386/apx-ppx-2.c 14 additions, 0 deletionsgcc/testsuite/gcc.target/i386/apx-ppx-2.c
- gcc/testsuite/gcc.target/i386/apx-ppx-3.c 7 additions, 0 deletionsgcc/testsuite/gcc.target/i386/apx-ppx-3.c
Loading
Please register or sign in to comment