]> gcc.gnu.org Git - gcc.git/commit
i386: Omit clobbers from vzeroupper until final [PR92190]
authorJakub Jelinek <jakub@redhat.com>
Wed, 5 Feb 2020 14:38:49 +0000 (15:38 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 5 Feb 2020 14:38:49 +0000 (15:38 +0100)
commitb7b3378f91c0641f2ef4d88db22af62a571c9359
tree3f47e7a32bb80b008ba7438ae86e74a685d20738
parent17a2e8c0918c2ddda82ace9ed17464906f96633d
i386: Omit clobbers from vzeroupper until final [PR92190]

As mentioned in the PR, the CLOBBERs in vzeroupper are added there even for
registers that aren't ever live in the function before and break the
prologue/epilogue expansion with ms ABI (normal ABIs are fine, as they
consider all [xyz]mm registers call clobbered, but the ms ABI considers
xmm0-15 call used but the bits above low 128 ones call clobbered).
The following patch fixes it by not adding the clobbers during vzeroupper
pass (before pro_and_epilogue), but adding them for -fipa-ra purposes only
during the final output.  Perhaps we could add some CLOBBERs early (say for
df_regs_ever_live_p regs that aren't live in the live_regs bitmap, or
depending on the ABI either add all of them immediately, or for ms ABI add
CLOBBERs for xmm0-xmm5 if they don't have a SET) and add the rest later.
And the addition could be perhaps done at other spots, e.g. in an
epilogue_completed guarded splitter.

2020-02-05  Jakub Jelinek  <jakub@redhat.com>

PR target/92190
* config/i386/i386-features.c (ix86_add_reg_usage_to_vzeroupper): Only
include sets and not clobbers in the vzeroupper pattern.
* config/i386/sse.md (*avx_vzeroupper): Require in insn condition that
the parallel has 17 (64-bit) or 9 (32-bit) elts.
(*avx_vzeroupper_1): New define_insn_and_split.

* gcc.target/i386/pr92190.c: New test.
gcc/ChangeLog
gcc/config/i386/i386-features.c
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr92190.c [new file with mode: 0644]
This page took 0.062834 seconds and 5 git commands to generate.