i386: Add X86_TUNE_EMIT_VZEROUPPER
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 15 Nov 2017 19:30:58 +0000 (19:30 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 15 Nov 2017 19:30:58 +0000 (11:30 -0800)
commit348188bf59ad01b6575165ef52e72dd58d331735
tree2cbdb40ab76164958e7ecb5cde1c55f5dbc40a67
parent41e181973e27274f2d188b9eff0c5935b76d559c
i386: Add X86_TUNE_EMIT_VZEROUPPER

Add X86_TUNE_EMIT_VZEROUPPER to indicate if vzeroupper instruction should
be inserted before a transfer of control flow out of the function.  It is
turned on by default unless we are tuning for KNL.  Users can always use
-mzeroupper or -mno-zeroupper to override X86_TUNE_EMIT_VZEROUPPER.

gcc/

PR target/82990
* config/i386/i386.c (pass_insert_vzeroupper::gate): Remove
TARGET_AVX512ER check.
(ix86_option_override_internal): Set MASK_VZEROUPPER if
neither -mzeroupper nor -mno-zeroupper is used and
TARGET_EMIT_VZEROUPPER is set.
* config/i386/i386.h (TARGET_EMIT_VZEROUPPER): New.
* config/i386/x86-tune.def: Add X86_TUNE_EMIT_VZEROUPPER.

gcc/testsuite/

PR target/82990
* gcc.target/i386/pr82942-2.c: Add -mtune=knl.
* gcc.target/i386/pr82990-1.c: New test.
* gcc.target/i386/pr82990-2.c: Likewise.
* gcc.target/i386/pr82990-3.c: Likewise.
* gcc.target/i386/pr82990-4.c: Likewise.
* gcc.target/i386/pr82990-5.c: Likewise.
* gcc.target/i386/pr82990-6.c: Likewise.
* gcc.target/i386/pr82990-7.c: Likewise.

From-SVN: r254783
13 files changed:
gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/x86-tune.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr82942-2.c
gcc/testsuite/gcc.target/i386/pr82990-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82990-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82990-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82990-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82990-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82990-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr82990-7.c [new file with mode: 0644]