[llvm-branch-commits] [llvm] [mlir] [mlir][llvmir][OpenMP] Translate affinity clause in task construct to llvmir (PR #182223)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 18 22:01:58 PST 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 131001 tests passed
* 2943 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### MLIR
<details>
<summary>MLIR.Target/LLVMIR/openmp-todo.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\mlir-translate.exe -mlir-to-llvmir -split-input-file -verify-diagnostics C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-todo.mlir
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\mlir-translate.exe' -mlir-to-llvmir -split-input-file -verify-diagnostics 'C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-todo.mlir'
# .---command stdout------------
# | ; ModuleID = 'LLVMDialectModule'
# | source_filename = "LLVMDialectModule"
# | 
# | define void @atomic_hint(ptr %0, ptr %1, i32 %2) {
# |   br label %entry
# | 
# | entry:                                            ; preds = %3
# |   %4 = atomicrmw xchg ptr %0, i32 %2 monotonic, align 4
# |   store i32 %4, ptr %1, align 4
# |   %omp.atomic.read = load atomic i32, ptr %0 monotonic, align 4
# |   store i32 %omp.atomic.read, ptr %1, align 4
# |   store atomic i32 %2, ptr %0 monotonic, align 4
# |   %5 = atomicrmw add ptr %1, i32 %2 monotonic, align 4
# |   %6 = add i32 %5, %2
# |   ret void
# | }
# | 
# | !llvm.module.flags = !{!0}
# | 
# | !0 = !{i32 2, !"Debug Info Version", i32 3}
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | 
# | ; ModuleID = 'LLVMDialectModule'
# | source_filename = "LLVMDialectModule"
# | 
# | %struct.ident_t = type { i32, i32, i32, i32, ptr }
# | 
# | @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
# | @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8
# | 
# | define void @task_affinity(ptr %0, i64 %1) {
# |   br label %entry
# | 
# | entry:                                            ; preds = %2
# |   br label %omp.private.init
# | 
# | omp.private.init:                                 ; preds = %entry
# |   br label %omp.private.copy
# | 
# | omp.private.copy:                                 ; preds = %omp.private.init
# |   br label %omp.task.start
# | 
# | omp.task.start:                                   ; preds = %omp.private.copy
# |   %omp.affinity_list = alloca { i64, i64, i32 }, i64 1, align 8
# |   %omp.affinity.entry = getelementptr inbounds { i64, i64, i32 }, ptr %omp.affinity_list, i64 0
# |   %3 = ptrtoint ptr %0 to i64
# |   %4 = getelementptr inbounds nuw { i64, i64, i32 }, ptr %omp.affinity.entry, i32 0, i32 0
# |   store i64 %3, ptr %4, align 4
# |   %5 = getelementptr inbounds nuw { i64, i64, i32 }, ptr %omp.affinity.entry, i32 0, i32 1
# |   store i64 %1, ptr %5, align 4
# |   %6 = getelementptr inbounds nuw { i64, i64, i32 }, ptr %omp.affinity.entry, i32 0, i32 2
# |   store i32 0, ptr %6, align 4
# |   br label %codeRepl
# | 
# | codeRepl:                                         ; preds = %omp.task.start
# |   %omp_global_thread_num = call i32 @__kmpc_global_thread_num(ptr @1)
# |   %7 = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 %omp_global_thread_num, i32 1, i64 40, i64 0, ptr @task_affinity..omp_par)
# |   %8 = call i32 @__kmpc_omp_reg_task_with_affinity(ptr @1, i32 %omp_global_thread_num, ptr %7, i32 1, ptr %omp.affinity_list)
# |   %9 = call i32 @__kmpc_omp_task(ptr @1, i32 %omp_global_thread_num, ptr %7)
# |   br label %task.exit
# | 
# | task.exit:                                        ; preds = %codeRepl
# |   ret void
# | }
# | 
# | define internal void @task_affinity..omp_par(i32 %global.tid.val) {
# | task.alloca:
# |   br label %task.body
# | 
# | task.body:                                        ; preds = %task.alloca
# |   br label %omp.task.region
# | 
# | omp.task.region:                                  ; preds = %task.body
# |   br label %omp.region.cont
# | 
# | omp.region.cont:                                  ; preds = %omp.task.region
# |   br label %task.exit.exitStub
# | 
# | task.exit.exitStub:                               ; preds = %omp.region.cont
# |   ret void
# | }
# | 
# | ; Function Attrs: nounwind
# | declare noalias ptr @__kmpc_omp_task_alloc(ptr, i32, i32, i64, i64, ptr) #0
# | 
# | ; Function Attrs: nounwind
# | declare i32 @__kmpc_global_thread_num(ptr) #0
# | 
# | ; Function Attrs: nounwind
# | declare i32 @__kmpc_omp_reg_task_with_affinity(ptr, i32, ptr, i32, ptr) #0
# | 
# | ; Function Attrs: nounwind
# | declare i32 @__kmpc_omp_task(ptr, i32, ptr) #0
# | 
# | attributes #0 = { nounwind }
# | 
# | !llvm.module.flags = !{!0}
# | 
# | !0 = !{i32 2, !"Debug Info Version", i32 3}
# `-----------------------------
# .---command stderr------------
# | within split at C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-todo.mlir:477 offset :3:6: error: expected error "not yet implemented: omp.affinity_entry" was not produced
# |   // expected-error at below {{not yet implemented: omp.affinity_entry}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | within split at C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-todo.mlir:477 offset :4:6: error: expected error "LLVM Translation failed for operation: omp.affinity_entry" was not produced
# |   // expected-error at below {{LLVM Translation failed for operation: omp.affinity_entry}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the llvm-branch-commits mailing list