]> gcc.gnu.org Git - gcc.git/commit
Fix _mm256_zeroupper by representing the instructions as call_insns in which the...
authorliuhongt <hongtao.liu@intel.com>
Tue, 1 Jun 2021 01:09:44 +0000 (09:09 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 7 Jun 2021 02:25:07 +0000 (10:25 +0800)
commit9a90b311f22956addaf4f5f9bdb3592afd45083f
tree5a13931e235551b3b9b33235929ca269d4ba0cb5
parent16465ceb06cc1f65cfca3c0eb2c1ee27ab03bdfd
Fix _mm256_zeroupper by representing the instructions as call_insns in which the call has a special vzeroupper ABI.

When __builtin_ia32_vzeroupper is called explicitly, the corresponding
vzeroupper pattern does not carry any CLOBBERS or SETs before LRA,
which leads to incorrect optimization in pass_reload. In order to
solve this problem, this patch refine instructions as call_insns in
which the call has a special vzeroupper ABI.

gcc/ChangeLog:

PR target/82735
* config/i386/i386-expand.c (ix86_expand_builtin): Remove
assignment of cfun->machine->has_explicit_vzeroupper.
* config/i386/i386-features.c
(ix86_add_reg_usage_to_vzerouppers): Delete.
(ix86_add_reg_usage_to_vzeroupper): Ditto.
(rest_of_handle_insert_vzeroupper): Remove
ix86_add_reg_usage_to_vzerouppers, add df_analyze at the end
of the function.
(gate): Remove cfun->machine->has_explicit_vzeroupper.
* config/i386/i386-protos.h (ix86_expand_avx_vzeroupper):
Declared.
* config/i386/i386.c (ix86_insn_callee_abi): New function.
(ix86_initialize_callee_abi): Ditto.
(ix86_expand_avx_vzeroupper): Ditto.
(ix86_hard_regno_call_part_clobbered): Adjust for vzeroupper
ABI.
(TARGET_INSN_CALLEE_ABI): Define as ix86_insn_callee_abi.
(ix86_emit_mode_set): Call ix86_expand_avx_vzeroupper
directly.
* config/i386/i386.h (struct GTY(()) machine_function): Delete
has_explicit_vzeroupper.
* config/i386/i386.md (enum unspec): New member
UNSPEC_CALLEE_ABI.
(ABI_DEFAULT,ABI_VZEROUPPER,ABI_UNKNOWN): New
define_constants for insn callee abi index.
* config/i386/predicates.md (vzeroupper_pattern): Adjust.
* config/i386/sse.md (UNSPECV_VZEROUPPER): Deleted.
(avx_vzeroupper): Call ix86_expand_avx_vzeroupper.
(*avx_vzeroupper): Rename to ..
(avx_vzeroupper_callee_abi): .. this, and adjust pattern as
call_insn which has a special vzeroupper ABI.
(*avx_vzeroupper_1): Deleted.

gcc/testsuite/ChangeLog:

PR target/82735
* gcc.target/i386/pr82735-1.c: New test.
* gcc.target/i386/pr82735-2.c: New test.
* gcc.target/i386/pr82735-3.c: New test.
* gcc.target/i386/pr82735-4.c: New test.
* gcc.target/i386/pr82735-5.c: New test.
13 files changed:
gcc/config/i386/i386-expand.c
gcc/config/i386/i386-features.c
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md
gcc/config/i386/predicates.md
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/pr82735-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82735-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82735-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82735-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82735-5.c [new file with mode: 0644]
This page took 0.064622 seconds and 5 git commands to generate.