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

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 10 02:05:49 PDT 2025


================
@@ -5003,16 +5003,17 @@ static void createTargetLoopWorkshareCall(OpenMPIRBuilder *OMPBuilder,
   RealArgs.push_back(ConstantInt::get(TripCountTy, 0));
   if (LoopType == WorksharingLoopType::DistributeForStaticLoop) {
     RealArgs.push_back(ConstantInt::get(TripCountTy, 0));
-  }
-  RealArgs.push_back(ConstantInt::get(Builder.getInt8Ty(), 0));
+    RealArgs.push_back(ConstantInt::get(Builder.getInt8Ty(), NoLoop));
+  } else
+    RealArgs.push_back(ConstantInt::get(Builder.getInt8Ty(), 0));
----------------
Meinersbur wrote:

```suggestion
  } else {
    RealArgs.push_back(ConstantInt::get(Builder.getInt8Ty(), 0));
  }
```
[if/else chains should not use braced bodies for either all or none of its members](https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements)

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


More information about the llvm-commits mailing list