Fix ivopts estimates for internal functions
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 26 May 2016 15:49:22 +0000 (15:49 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 26 May 2016 15:49:22 +0000 (15:49 +0000)
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.

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

From-SVN: r236780

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index 8fe8a26f394b05e3c464f2c96f87c25cf804367f..d31de13336fa8d1cd4d23fd517e6c6c6ab766dc8 100644 (file)
@@ -1,3 +1,8 @@
+2016-05-26  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * tree-ssa-loop-ivopts.c (loop_body_includes_call): Don't assume
+       that internal functions will clobber all caller-saved registers.
+
 2016-05-26  Wilco Dijkstra  <wdijkstr@arm.com>
 
        * config/aarch64/aarch64.c (aarch64_case_values_threshold):
index 9ce6b64951976ee4583a9fda89cace8336a2a294..23c988620c351a3f6732538ee15cccfe58de181f 100644 (file)
@@ -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;
       }