diff mbox

Fix ivopts estimates for internal functions

Message ID 871t4oeveh.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford May 26, 2016, 2:39 p.m. UTC
tree-ssa-loop-ivopts.c:loop_body_includes_call was treating internal
calls such as IFN_SQRT as clobbering all caller-saved registers, which
I don't think is appropriate for any current internal function.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Thanks,
Richard


gcc/
	* tree-ssa-loop-ivopts.c (loop_body_includes_call): Don't assume
	that internal functions will clobber all caller-saved registers.

Comments

Richard Biener May 26, 2016, 3:36 p.m. UTC | #1
On May 26, 2016 4:39:02 PM GMT+02:00, Richard Sandiford <richard.sandiford@arm.com> wrote:
>tree-ssa-loop-ivopts.c:loop_body_includes_call was treating internal
>calls such as IFN_SQRT as clobbering all caller-saved registers, which
>I don't think is appropriate for any current internal function.
>
>Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

OK.

Richard.

>Thanks,
>Richard
>
>
>gcc/
>	* tree-ssa-loop-ivopts.c (loop_body_includes_call): Don't assume
>	that internal functions will clobber all caller-saved registers.
>
>diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
>index 9ce6b64..23c9886 100644
>--- a/gcc/tree-ssa-loop-ivopts.c
>+++ b/gcc/tree-ssa-loop-ivopts.c
>@@ -7643,6 +7643,7 @@ loop_body_includes_call (basic_block *body,
>unsigned num_nodes)
>       {
> 	gimple *stmt = gsi_stmt (gsi);
> 	if (is_gimple_call (stmt)
>+	    && !gimple_call_internal_p (stmt)
> 	    && !is_inexpensive_builtin (gimple_call_fndecl (stmt)))
> 	  return true;
>       }
diff mbox

Patch

diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 9ce6b64..23c9886 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -7643,6 +7643,7 @@  loop_body_includes_call (basic_block *body, unsigned num_nodes)
       {
 	gimple *stmt = gsi_stmt (gsi);
 	if (is_gimple_call (stmt)
+	    && !gimple_call_internal_p (stmt)
 	    && !is_inexpensive_builtin (gimple_call_fndecl (stmt)))
 	  return true;
       }