[flang-commits] [flang] [flang][OpenMP] Rewrite standalone `loop` (without `bind`) directives to `simd` (PR #122632)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Mon Jan 13 06:07:39 PST 2025


================
@@ -30,19 +30,37 @@ class GenericLoopConversionPattern
     : public mlir::OpConversionPattern<mlir::omp::LoopOp> {
 public:
   enum class GenericLoopCombinedInfo {
-    None,
+    Standalone,
     TargetTeamsLoop,
     TargetParallelLoop
----------------
skatrak wrote:

Should we be checking for `target` anywhere in this pass? By looking at the comments you extracted from the spec into comments below, it seems like this pass would be interested in rewriting:
- `[...] teams loop`: `[...] teams distribute parallel do/for`
- `[...] parallel loop`: `[...] parallel do/for`
- `loop`: `simd`

I would suggest renaming these enum values to `TeamsLoop` and `ParallelLoop`, update `findGenericLoopCombineInfo` to not check for `omp.target` and remove any references to `target` in error messages. Unless of course I misunderstood the `loop` construct and it is indeed only usable in target regions.

https://github.com/llvm/llvm-project/pull/122632


More information about the flang-commits mailing list