aboutsummaryrefslogtreecommitdiff
path: root/gcc/omp-low.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:20:19 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:20:19 +0000
commit16d2200070f49ed71053b81699e37bd539a0ee69 (patch)
treec89eef6816d81c30d7695888167b3345c11aae26 /gcc/omp-low.c
parentf4f6058097d99812ee3eda98d09c23fccdc7ba94 (diff)
downloadgcc-16d2200070f49ed71053b81699e37bd539a0ee69.zip
gcc-16d2200070f49ed71053b81699e37bd539a0ee69.tar.gz
gcc-16d2200070f49ed71053b81699e37bd539a0ee69.tar.bz2
[71/77] Use opt_scalar_mode for mode iterators
This patch uses opt_scalar_mode when iterating over scalar modes. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * coretypes.h (opt_scalar_mode): New typedef. * gdbhooks.py (build_pretty_printers): Handle it. * machmode.h (mode_iterator::get_2xwider): Add overload for opt_mode<T>. * emit-rtl.c (init_emit_once): Use opt_scalar_mode when iterating over scalar modes. * expr.c (convert_mode_scalar): Likewise. * omp-low.c (omp_clause_aligned_alignment): Likewise. * optabs.c (expand_float): Likewise. (expand_fix): Likewise. * tree-vect-stmts.c (vectorizable_conversion): Likewise. gcc/c-family/ * c-common.c (c_common_fixed_point_type_for_size): Use opt_scalar_mode for the mode iterator. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251522
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r--gcc/omp-low.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 5deb539..080f2f4 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -3442,16 +3442,18 @@ omp_clause_aligned_alignment (tree clause)
/* Otherwise return implementation defined alignment. */
unsigned int al = 1;
- machine_mode mode, vmode;
+ opt_scalar_mode mode_iter;
int vs = targetm.vectorize.autovectorize_vector_sizes ();
if (vs)
vs = 1 << floor_log2 (vs);
static enum mode_class classes[]
= { MODE_INT, MODE_VECTOR_INT, MODE_FLOAT, MODE_VECTOR_FLOAT };
for (int i = 0; i < 4; i += 2)
- FOR_EACH_MODE_IN_CLASS (mode, classes[i])
+ /* The for loop above dictates that we only walk through scalar classes. */
+ FOR_EACH_MODE_IN_CLASS (mode_iter, classes[i])
{
- vmode = targetm.vectorize.preferred_simd_mode (mode);
+ scalar_mode mode = mode_iter.require ();
+ machine_mode vmode = targetm.vectorize.preferred_simd_mode (mode);
if (GET_MODE_CLASS (vmode) != classes[i + 1])
continue;
while (vs