[Bug tree-optimization/82604] [8 Regression] SPEC CPU2006 410.bwaves ~50% performance regression with trunk@253679 when ftree-parallelize-loops is used
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Nov 17 11:09:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82604
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
failed loop-distribution hack: (still needs dependence analysis fixes)
Could even preserve TBAA if we use a {} of correct element array type.
For constant sizes this should be always a win.
Index: gcc/tree-loop-distribution.c
===================================================================
--- gcc/tree-loop-distribution.c (revision 254858)
+++ gcc/tree-loop-distribution.c (working copy)
@@ -1006,9 +1006,22 @@ generate_memset_builtin (struct loop *lo
val = tem;
}
- fn = build_fold_addr_expr (builtin_decl_implicit (BUILT_IN_MEMSET));
- fn_call = gimple_build_call (fn, 3, mem, val, nb_bytes);
- gsi_insert_after (&gsi, fn_call, GSI_CONTINUE_LINKING);
+ if (! integer_zerop (val))
+ {
+ fn = build_fold_addr_expr (builtin_decl_implicit (BUILT_IN_MEMSET));
+ fn_call = gimple_build_call (fn, 3, mem, val, nb_bytes);
+ gsi_insert_after (&gsi, fn_call, GSI_CONTINUE_LINKING);
+ }
+ else
+ {
+ tree arrt = build_array_type (char_type_node, NULL_TREE);
+ gassign *ass = gimple_build_assign (build2 (MEM_REF, arrt,
+ mem, build_zero_cst
(ptr_type_node)),
+ build2 (WITH_SIZE_EXPR, arrt,
+ build_constructor (arrt,
NULL),
+ nb_bytes));
+ gsi_insert_after (&gsi, ass, GSI_CONTINUE_LINKING);
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
{
More information about the Gcc-bugs
mailing list