[PATCH] Explicitly annotate loops we want to run thread-parallel

Tobias Grosser tobias at grosser.es
Wed Nov 5 14:21:21 PST 2014


Hi jdoerfert, sebpop, dpeixott, simbuerg,

We introduces a new flag -polly-parallel and use it to annotate the for-nodes in
the isl ast that we want to execute thread parallel (e.g., using OpenMP). We
previously already emmitted openmp annotations, but we did this for various
kinds of parallel loops, including some which we can not run in parallel.

With this patch we now have three annotations:

  1) #pragma known-parallel [reduction]
  2) #pragma omp for
  3) #pragma simd

meaning:

  1) loop has no loop carried dependences
  2) loop will be executed thread-parallel
  3) loop can possibly be vectorized

This patch introduces 1) and reduces the use of 2) to only the cases where we
know generate thread parallel code.

It is in preparation of openmp code generation in our isl backend.

Legacy:

- We also have a command line option -enable-polly-openmp. This option controls
  the OpenMP code generation in CLooG. It will become an alias of
  -polly-parallel after the CLooG code generation has been dropped.

http://reviews.llvm.org/D6142

Files:
  include/polly/CodeGen/IslAst.h
  lib/CodeGen/IslAst.cpp
  test/Isl/Ast/OpenMP/multiple_loops_outer_parallel.ll
  test/Isl/Ast/OpenMP/nested_loop_both_parallel.ll
  test/Isl/Ast/OpenMP/nested_loop_both_parallel_parametric.ll
  test/Isl/Ast/OpenMP/nested_loop_inner_parallel.ll
  test/Isl/Ast/OpenMP/nested_loop_outer_parallel.ll
  test/Isl/Ast/OpenMP/single_loop_param_non_parallel.ll
  test/Isl/Ast/OpenMP/single_loop_param_parallel.ll
  test/Isl/Ast/OpenMP/single_loop_param_parallel_computeout.ll
  test/Isl/Ast/reduction_clauses_multidimensional_access.ll
  test/Isl/Ast/reduction_clauses_onedimensional_access.ll
  test/Isl/Ast/reduction_different_reduction_clauses.ll
  test/Isl/Ast/reduction_in_one_dimension.ll
  test/Isl/Ast/reduction_modulo_and_loop_reversal_schedule_2.ll
  test/Isl/Ast/reduction_modulo_schedule_multiple_dimensions.ll
  test/Isl/Ast/reduction_modulo_schedule_multiple_dimensions_2.ll
  test/Isl/Ast/reduction_modulo_schedule_multiple_dimensions_3.ll
  test/Isl/Ast/reduction_modulo_schedule_multiple_dimensions_4.ll
  test/Isl/Ast/reduction_modulo_schedule_multiple_dimensions_5.ll
  test/Isl/Ast/reduction_multiple_dimensions.ll
  test/Isl/Ast/reduction_multiple_dimensions_2.ll
  test/Isl/Ast/reduction_multiple_dimensions_3.ll
  test/Isl/Ast/reduction_multiple_dimensions_4.ll
  test/Isl/Ast/single_loop_strip_mine.ll
  test/ScheduleOptimizer/prevectorization.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6142.15829.patch
Type: text/x-patch
Size: 18753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141105/b8a01045/attachment.bin>


More information about the llvm-commits mailing list