]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386-protos.h (ix86_maybe_emit_epilogue_vzeroupper): New prototype.
authorJakub Jelinek <jakub@redhat.com>
Fri, 11 Nov 2011 19:58:10 +0000 (20:58 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 11 Nov 2011 19:58:10 +0000 (20:58 +0100)
* 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

gcc/ChangeLog
gcc/config/i386/i386-protos.h
gcc/config/i386/i386.c
gcc/config/i386/i386.md

index 40c57d161cb5eea4fce5fdb272cb956c06f1fd2c..73bec2249f271d1e55b9108a693b7b3968ef1182 100644 (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.
index 6bfe13d47d6b529823de6dd1272417bf49f8d8c1..630112f625d96266a5a6179552d02a2ecd5948e9 100644 (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);
 
index f39eb116f7755a187cfc5c7d8e70071ec1b6f368..7c5814f21c309f7191b8c2b4c7ab39e4dca7f331 100644 (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)
     {
index 377c78eec51240f8151320ad74a49177cc3c6ba6..bc6025323047a54936931528c09d55f4288010f6 100644 (file)
   [(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);
   [(simple_return)]
   "!TARGET_SEH"
 {
+  ix86_maybe_emit_epilogue_vzeroupper ();
   if (crtl->args.pops_args)
     {
       rtx popc = GEN_INT (crtl->args.pops_args);