+2018-09-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR tree-optimization/87259
+ PR lto/87283
+ (pass_cse_reciprocals::execute): Run optimize_recip_sqrt after
+ execute_cse_reciprocals_1 has tried transforming.
+
2018-09-14 Aldy Hernandez <aldyh@redhat.com>
* tree-vrp.c (extract_range_from_binary_expr_1): Normalize
+2018-09-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR tree-optimization/87259
+ * gcc.dg/pr87259.c: New test.
+
2018-09-13 Martin Sebor <msebor@redhat.com>
Jeff Law <law@redhat.com>
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+
+int a, b, c;
+int *e;
+float f;
+void h() {
+ for (int g;;) {
+ float d = b, i = 0 / f, j = a / (f * f), k, l = 0 / d;
+ c = i + j;
+ g = l;
+ e[g] = c / d * k / d;
+ }
+}
depending on the uses of x, r1, r2. This removes one multiplication and
allows the sqrt and division operations to execute in parallel.
DEF_GSI is the gsi of the initial division by sqrt that defines
- DEF (x in the example abovs). */
+ DEF (x in the example above). */
static void
optimize_recip_sqrt (gimple_stmt_iterator *def_gsi, tree def)
&& FLOAT_TYPE_P (TREE_TYPE (def))
&& TREE_CODE (def) == SSA_NAME)
{
+ execute_cse_reciprocals_1 (&gsi, def);
+ stmt = gsi_stmt (gsi);
if (flag_unsafe_math_optimizations
&& is_gimple_assign (stmt)
&& !stmt_can_throw_internal (stmt)
&& gimple_assign_rhs_code (stmt) == RDIV_EXPR)
optimize_recip_sqrt (&gsi, def);
- else
- execute_cse_reciprocals_1 (&gsi, def);
}
}