[Mlir-commits] [clang] [flang] [llvm] [mlir] [OMPIRBuilder] Pass work loop type in ident flags (PR #189347)

Jan André Reuter llvmlistbot at llvm.org
Fri Apr 10 09:48:44 PDT 2026


================
@@ -5498,7 +5510,8 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::applyStaticWorkshareLoop(
   Builder.CreateStore(UpperBound, PUpperBound);
   Builder.CreateStore(One, PStride);
 
-  Value *ThreadNum = getOrCreateThreadID(SrcLoc);
+  Value *ThreadNum =
+      getOrCreateThreadID(getOrCreateIdent(SrcLocStr, SrcLocStrSize));
----------------
Thyre wrote:

In an earlier revision, I used the created `Flag`. This seemed to work fine as well.
Looking at [`__kmpc_global_thread_num`](https://github.com/llvm/llvm-project/blob/f5eb99ac14a1ca5f2a9771ada2c8c672b430f253/openmp/runtime/src/kmp_csupport.cpp#L100), the passed `ident_t` seems to be entirely unused.

The current implementation is more consistent with the remainder of `OMPIRBuilder`. All calls to `getOrCreateThreadID` do not pass any `LocFlags` or `Reserve2Flags` as far as I can tell. 

I'm fine with changing this to whatever fits best.

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


More information about the Mlir-commits mailing list