[clang] [OpenMP] Pass min/max thread and team count to the OMPIRBuilder (PR #70247)

Johannes Doerfert via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 26 14:40:35 PDT 2023


================
@@ -607,8 +608,13 @@ void CodeGenModule::handleAMDGPUFlatWorkGroupSizeAttr(
   if (Min != 0) {
     assert(Min <= Max && "Min must be less than or equal Max");
 
+    if (MinThreadsVal)
+      *MinThreadsVal = Min;
+    if (MaxThreadsVal)
+      *MaxThreadsVal = Max;
     std::string AttrVal = llvm::utostr(Min) + "," + llvm::utostr(Max);
-    F->addFnAttr("amdgpu-flat-work-group-size", AttrVal);
+    if (F)
----------------
jdoerfert wrote:

In the commit I call the function with a nullptr to get the Min/Max values out and while preserving all the reasoning that may impact them. 

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


More information about the cfe-commits mailing list