This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR84777
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 9 Mar 2018 14:23:13 +0100 (CET)
- Subject: [PATCH] Fix PR84777
- Authentication-results: sourceware.org; auth=none
With -Os we inhibit most loop header copying which in turn will disable
any vectorization attempt either via -fopenmp or via -ftree-vectorize.
The following makes sure the aggressive gate in
should_duplicate_loop_header_p is not applied for force-vectorize loops.
There's still PARAM_MAX_LOOP_HEADER_INSNS limiting growth.
This reportedly makes -fopenmp -Os vectorize loops properly.
Bootstrap / regtest running on x86_64-unknown-linux-gnu.
Is this OK for trunk (and branches?) or do we want sth different
in the end?
Thanks,
Richard.
2018-03-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/84777
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p): For
force-vectorize loops ignore whether we are optimizing for size.
Index: gcc/tree-ssa-loop-ch.c
===================================================================
--- gcc/tree-ssa-loop-ch.c (revision 258380)
+++ gcc/tree-ssa-loop-ch.c (working copy)
@@ -57,7 +57,8 @@ should_duplicate_loop_header_p (basic_bl
be true, since quite often it is possible to verify that the condition is
satisfied in the first iteration and therefore to eliminate it. Jump
threading handles these cases now. */
- if (optimize_loop_for_size_p (loop))
+ if (optimize_loop_for_size_p (loop)
+ && !loop->force_vectorize)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,