https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91994

--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> 
---
Author: rsandifo
Date: Mon Oct  7 08:36:06 2019
New Revision: 276648

URL: https://gcc.gnu.org/viewcvs?rev=276648&root=gcc&view=rev
Log:
[i386] Make the vzeroupper pattern describe its effects (PR91994)

The problem in this PR was that vzeroupper has an effect on register
contents, but those effects weren't modelled in the rtl pattern,
which was just an unspec_volatile.

This patch fixes that by running a subpass after vzeroupper insertion
to add SETs and CLOBBERs as appropriate.  See the comments in the patch
for more details.

2019-10-07  Richard Sandiford  <richard.sandif...@arm.com>

gcc/
        PR target/91994
        * config/i386/sse.md (avx_vzeroupper): Turn into a define_expand
        and wrap the unspec_volatile in a parallel.
        (*avx_vzeroupper): New define_insn.  Use a match_parallel around
        the unspec_volatile.
        * config/i386/predicates.md (vzeroupper_pattern): Expect the
        unspec_volatile to be wrapped in a parallel.
        * config/i386/i386-features.c (ix86_add_reg_usage_to_vzeroupper)
        (ix86_add_reg_usage_to_vzerouppers): New functions.
        (rest_of_handle_insert_vzeroupper): Use them to add register
        usage information to the vzeroupper instructions.

gcc/testsuite/
        PR target/91994
        * gcc.target/i386/pr91994.c: New test.

Added:
    trunk/gcc/testsuite/gcc.target/i386/pr91994.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386-features.c
    trunk/gcc/config/i386/predicates.md
    trunk/gcc/config/i386/sse.md
    trunk/gcc/testsuite/ChangeLog

Reply via email to