i386-protos.h (ix86_maybe_emit_epilogue_vzeroupper): New prototype.

* config/i386/i386-protos.h (ix86_maybe_emit_epilogue_vzeroupper):
	New prototype.
	* config/i386/i386.c (ix86_maybe_emit_epilogue_vzeroupper): New
	function.
	(ix86_expand_epilogue): Use it.
	* config/i386/i386.md (return, simple_return): Call it in the
	expanders.

From-SVN: r181300
This commit is contained in:
Jakub Jelinek 2011-11-11 20:58:10 +01:00 committed by Jakub Jelinek
parent bad2545327
commit 292b44341c
4 changed files with 23 additions and 4 deletions

View File

@ -1,5 +1,13 @@
2011-11-11 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386-protos.h (ix86_maybe_emit_epilogue_vzeroupper):
New prototype.
* config/i386/i386.c (ix86_maybe_emit_epilogue_vzeroupper): New
function.
(ix86_expand_epilogue): Use it.
* config/i386/i386.md (return, simple_return): Call it in the
expanders.
PR tree-optimization/51091
* tree-stdarg.c (execute_optimize_stdarg): Ignore TREE_CLOBBER_P
rhs also in the va_list_simple_ptr case.

View File

@ -32,6 +32,7 @@ extern void ix86_setup_frame_addresses (void);
extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);
extern void ix86_expand_prologue (void);
extern void ix86_maybe_emit_epilogue_vzeroupper (void);
extern void ix86_expand_epilogue (int);
extern void ix86_expand_split_stack_prologue (void);

View File

@ -10614,6 +10614,17 @@ ix86_emit_restore_sse_regs_using_mov (HOST_WIDE_INT cfa_offset,
}
}
/* Emit vzeroupper if needed. */
void
ix86_maybe_emit_epilogue_vzeroupper (void)
{
if (TARGET_VZEROUPPER
&& !TREE_THIS_VOLATILE (cfun->decl)
&& !cfun->machine->caller_return_avx256_p)
emit_insn (gen_avx_vzeroupper (GEN_INT (call_no_avx256)));
}
/* Restore function stack, frame, and registers. */
void
@ -10911,10 +10922,7 @@ ix86_expand_epilogue (int style)
}
/* Emit vzeroupper if needed. */
if (TARGET_VZEROUPPER
&& !TREE_THIS_VOLATILE (cfun->decl)
&& !cfun->machine->caller_return_avx256_p)
emit_insn (gen_avx_vzeroupper (GEN_INT (call_no_avx256)));
ix86_maybe_emit_epilogue_vzeroupper ();
if (crtl->args.pops_args && crtl->args.size)
{

View File

@ -11736,6 +11736,7 @@
[(simple_return)]
"ix86_can_use_return_insn_p ()"
{
ix86_maybe_emit_epilogue_vzeroupper ();
if (crtl->args.pops_args)
{
rtx popc = GEN_INT (crtl->args.pops_args);
@ -11752,6 +11753,7 @@
[(simple_return)]
"!TARGET_SEH"
{
ix86_maybe_emit_epilogue_vzeroupper ();
if (crtl->args.pops_args)
{
rtx popc = GEN_INT (crtl->args.pops_args);