[PATCH] D69088: [Lex] #pragma clang transform

Michael Kruse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 17 14:27:50 PDT 2019


Meinersbur added a comment.

In D69088#1713147 <https://reviews.llvm.org/D69088#1713147>, @ABataev wrote:

> Why not try to improve the existing #pragma clang loop rather than add a new pragma with almost the same behavior?


The behavior and syntax is different. #pragma clang loop ignores the order, i.e.

  #pragma clang loop unroll(enable)
  #pragma clang loop distribute(enable)

and

  #pragma clang loop distribute(enable)
  #pragma clang loop unroll(enable)

and

  #pragma clang loop unroll(enable) distribute(enable)

are the same. Changing that would be a breaking change.

Syntactically, every option is it's own transformation, e.g.

  #pragma clang loop unroll(enable) distribute(enable) unroll_count(2)

could be interpreted as 3 transformations (LoopUnroll even exists twice in the pass pipeline). I prefer OpenMP's directive-with-clauses syntax, which we need to implement anyway for the OpenMP loop transformations.

In the future, I would also like to add non-loop transformation, such that the `loop` namespace l


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69088/new/

https://reviews.llvm.org/D69088





More information about the cfe-commits mailing list