This is the mail archive of the
mailing list for the GCC project.
Re: New GCC options for loop vectorization
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Xinliang David Li <davidxl at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 16 Sep 2013 12:17:54 +0200
- Subject: Re: New GCC options for loop vectorization
- Authentication-results: sourceware.org; auth=none
- References: <CAAkRFZJzPkDJe=y2RqDwXsegN1So-u8mvUM2Cc2=4yZm29ip5g at mail dot gmail dot com> <CAFiYyc204YzVZVSOKnzomiMZs0Spe7=8AMUz+ho-xzr6beahXg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1309131641400 dot 13483 at digraph dot polyomino dot org dot uk> <CAAkRFZJYscE2zveW_H2shjWVQhFUcpBnLbErbZUvKExQ1+v9sw at mail dot gmail dot com> <CAAkRFZKiGcyeAG-dNFVc1RwKZdaBLcE6d4j1D_GeOqV39mJSwQ at mail dot gmail dot com> <CAFiYyc3dmGdpvv_WFT=Ri29+BnMHKzafj8A0prghRkeSwRJq7Q at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Sep 16, 2013 at 12:07:37PM +0200, Richard Biener wrote:
> On Fri, Sep 13, 2013 at 6:56 PM, Xinliang David Li <email@example.com> wrote:
> > Updated patch implementing the logic that more specific option wins.
> > Ok for trunk?
> @@ -2305,8 +2305,8 @@ omp_max_vf (void)
> if (!optimize
> || optimize_debug
> - || (!flag_tree_vectorize
> - && global_options_set.x_flag_tree_vectorize))
> + || (!flag_tree_loop_vectorize
> + && global_options_set.x_flag_tree_loop_vectorize))
> return 1;
> Not sure what is the intent here, but it looks like
> -fno-tree-vectorize will no longer disable this. So it would
> need to check (global_options_set.x_flag_tree_vectorize ||
> global_options_set.x_flag_tree_loop_vectorize)? Jakub?
The point of omp_max_vf is to allow vectorization of simd routines
in the source even without -O3/-Ofast/-ftree-vectorize, as long
as user hasn't requested no vectorization (-fno-tree-vectorize, or
-O0, -Og). So yes, you'd probably need to change this spot
to check for either global_options_set.x_flag_tree_vectorize
|| global_options_set.x_flag_tree_loop_vectorize, because either
of them meant explicit request to either vectorize or not vectorize loops.
If user has requested vectorization or non-vectorization of loops, then
simd loops just should follow those requests, it is only the default
if there was nothing explicit, which will for now be different between
normal and simd loops, normal loops won't be vectorized, simd loops will be,
because they were specially marked in the source and so it is probably
worthwhile to vectorize them.