[clang] [llvm] [mlir] [Flang][OpenMP] Enable no-loop kernels (PR #155818)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 24 06:17:09 PDT 2025


================
@@ -230,14 +230,24 @@ def TargetRegionFlagsNone : I32BitEnumAttrCaseNone<"none">;
 def TargetRegionFlagsGeneric : I32BitEnumAttrCaseBit<"generic", 0>;
 def TargetRegionFlagsSpmd : I32BitEnumAttrCaseBit<"spmd", 1>;
 def TargetRegionFlagsTripCount : I32BitEnumAttrCaseBit<"trip_count", 2>;
+def TargetRegionFlagsNoLoop : I32BitEnumAttrCaseBit<"no_loop", 3>;
 
 def TargetRegionFlags : OpenMP_BitEnumAttr<
     "TargetRegionFlags",
-    "target region property flags", [
+    "These flags describe properties of the target kernel. "
+    "TargetRegionFlagsGeneric - denotes generic kernel. "
+    "TargetRegionFlagsSpmd - denotes SPMD kernel. "
+    "TargetRegionFlagsNoLoop - denotes kernel where "
+    "num_teams * num_threads >= loop_trip_count. It allows the conversion "
+    "of loops into sequential code by ensuring that each team/thread "
+    "executes at most one iteration. "
+    "TargetRegionFlagsTripCount - checks if the loop trip count should be "
+    "calculated.", [
----------------
Meinersbur wrote:

This syntx might be possible here:
```suggestion
    [{ These flags describe properties of the target kernel. 
    
    TargetRegionFlagsGeneric - denotes generic kernel. 
    TargetRegionFlagsSpmd - denotes SPMD kernel. 
    TargetRegionFlagsNoLoop - denotes kernel where 
    num_teams * num_threads >= loop_trip_count. It allows the conversion 
    of loops into sequential code by ensuring that each team/thread 
    executes at most one iteration. 
    TargetRegionFlagsTripCount - checks if the loop trip count should be 
    calculated. }], [
```

This gets rendered has HTML (example: [source](https://github.com/llvm/llvm-project/blob/0a268f803cdf914f410728e0258524bb658e5b99/mlir/include/mlir/Dialect/OpenMP/OpenMPEnums.td#L117) [render](https://mlir.llvm.org/docs/Dialects/OpenMPDialect/ODS/#clausetaskdependattr)), will probably be a wall of text without line breaks. Don't know whether it is possible to use lists (markdown?)

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


More information about the cfe-commits mailing list