[flang-commits] [flang] [llvm] [mlir] [openmp][mlir] Expand use of atomicrmw for atomic update (PR #215654)

via flang-commits flang-commits at lists.llvm.org
Tue Aug 11 15:03:34 PDT 2026


github-actions[bot] wrote:

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

* 144248 tests passed
* 3926 tests skipped
* 2 tests failed

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

### MLIR
<details>
<summary>MLIR.Target/LLVMIR/openmp-llvm.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 C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\mlir-translate.exe' -mlir-to-llvmir -split-input-file 'C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir'
# .---command stderr------------
# | within split at C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:4122 offset :9:8: warning: groupprivate directive is currently ignored on the host, using original global
# |   %2 = omp.groupprivate @any1 device_type(any) : !llvm.ptr
# |        ^
# | within split at C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:4122 offset :9:8: note: see current operation: %1 = omp.groupprivate @any1 device_type (any) : !llvm.ptr
# | within split at C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:4122 offset :12:8: warning: groupprivate directive is currently ignored on the host, using original global
# |   %4 = omp.groupprivate @host1 device_type(host) : !llvm.ptr
# |        ^
# | within split at C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:4122 offset :12:8: note: see current operation: %2 = omp.groupprivate @host1 device_type (host) : !llvm.ptr
# `-----------------------------
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:2006:12: error: CHECK: expected string not found in input
# |  // CHECK: store i32 %[[t1]], ptr %[[x_new:.*]]
# |            ^
# | <stdin>:7054:46: note: scanning from here
# |  %4 = call i32 @llvm.smax.i32(i32 %3, i32 %1)
# |                                              ^
# | <stdin>:7054:46: note: with "t1" equal to "4"
# |  %4 = call i32 @llvm.smax.i32(i32 %3, i32 %1)
# |                                              ^
# | <stdin>:7054:46: note: pattern attempts to capture variables: "x_new"
# |  %4 = call i32 @llvm.smax.i32(i32 %3, i32 %1)
# |                                              ^
# | <stdin>:7056:25: note: possible intended match here
# |  %6 = call i32 @llvm.umax.i32(i32 %5, i32 %1)
# |                         ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:2205:12: error: CHECK: expected string not found in input
# |  // CHECK: %[[xval:.*]] = phi i32
# |            ^
# | <stdin>:7221:23: note: scanning from here
# |  store i32 %48, ptr %1, align 4
# |                       ^
# | <stdin>:7221:23: note: pattern attempts to capture variables: "xval"
# |  store i32 %48, ptr %1, align 4
# |                       ^
# | <stdin>:7223:2: note: possible intended match here
# |  %54 = call i32 @llvm.smax.i32(i32 %53, i32 %2)
# |  ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir:2444:12: error: CHECK: expected string not found in input
# |  // CHECK: %[[xval:.*]] = phi i32
# |            ^
# | <stdin>:7378:23: note: scanning from here
# |  store i32 %47, ptr %1, align 4
# |                       ^
# | <stdin>:7378:23: note: pattern attempts to capture variables: "xval"
# |  store i32 %47, ptr %1, align 4
# |                       ^
# | <stdin>:7380:2: note: possible intended match here
# |  %54 = call i32 @llvm.smax.i32(i32 %53, i32 %2)
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\mlir\test\Target\LLVMIR\openmp-llvm.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |               .
# |               .
# |               .
# |            7049: define void @omp_atomic_update_intrinsic(ptr %0, i32 %1) { 
# |            7050:  br label %entry 
# |            7051:  
# |            7052: entry: ; preds = %2 
# |            7053:  %3 = atomicrmw max ptr %0, i32 %1 monotonic, align 4 
# |            7054:  %4 = call i32 @llvm.smax.i32(i32 %3, i32 %1) 
# | check:2006'0                                                 {   search range start (exclusive)
# | check:2006'1                                                     error: no match found in search range
# | check:2006'2                                                     with "t1" equal to "4"
# | check:2006'3                                                     pattern attempts to capture variables: "x_new"
# |            7055:  %5 = atomicrmw umax ptr %0, i32 %1 monotonic, align 4 
# |            7056:  %6 = call i32 @llvm.umax.i32(i32 %5, i32 %1) 
# | check:2006'4                             ?                       possible intended match
# |            7057:  ret void 
# |            7058: } 
# |            7059:  
# |            7060: ; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none) 
# |            7061: declare i32 @llvm.smax.i32(i32, i32) #0 
# |               .
# |               .
# |               .
# |            7070: !0 = !{i32 2, !"Debug Info Version", i32 3} 
# |            7071:  
# |            7072: ; ModuleID = 'LLVMDialectModule' 
# |            7073: source_filename = "LLVMDialectModule" 
# |            7074:  
# |            7075: define void @atomic_update_cmpxchg(ptr %0, ptr %1) { 
# | check:2006'5                                       }                    search range end (exclusive)
# |            7076:  %x.new.val = alloca i32, align 4 
# |            7077:  %3 = load float, ptr %1, align 4 
# |            7078:  br label %entry 
# |            7079:  
# |            7080: entry: ; preds = %2 
# |               .
# |               .
# |               .
# |            7216:  %51 = extractvalue { i32, i1 } %50, 0 
# |            7217:  %52 = extractvalue { i32, i1 } %50, 1 
# |            7218:  br i1 %52, label %.atomic.exit18, label %.atomic.cont19 
# |            7219:  
# |            7220: .atomic.exit18: ; preds = %.atomic.cont19 
# |            7221:  store i32 %48, ptr %1, align 4 
# | check:2205'0                          {            search range start (exclusive)
# | check:2205'1                                       error: no match found in search range
# | check:2205'2                                       pattern attempts to capture variables: "xval"
# |            7222:  %53 = atomicrmw max ptr %0, i32 %2 monotonic, align 4 
# |            7223:  %54 = call i32 @llvm.smax.i32(i32 %53, i32 %2) 
# | check:2205'3      ?                                                possible intended match
# |            7224:  store i32 %54, ptr %1, align 4 
# |            7225:  %55 = atomicrmw min ptr %0, i32 %2 monotonic, align 4 
# |            7226:  %56 = call i32 @llvm.smin.i32(i32 %55, i32 %2) 
# |            7227:  store i32 %56, ptr %1, align 4 
# |            7228:  %57 = atomicrmw umax ptr %0, i32 %2 monotonic, align 4 
# |               .
# |               .
# |               .
# |            7259: !0 = !{i32 2, !"Debug Info Version", i32 3} 
# |            7260:  
# |            7261: ; ModuleID = 'LLVMDialectModule' 
# |            7262: source_filename = "LLVMDialectModule" 
# |            7263:  
# |            7264: define void @omp_atomic_capture_postfix_update(ptr %0, ptr %1, i32 %2, ptr %3, ptr %4, float %5) { 
# | check:2205'4                                                   }                                                      search range end (exclusive)
# |            7265:  %x.new.val20 = alloca i32, align 4 
# |            7266:  %x.new.val16 = alloca i32, align 4 
# |            7267:  %x.new.val12 = alloca i32, align 4 
# |            7268:  %x.new.val8 = alloca i32, align 4 
# |            7269:  %x.new.val4 = alloca i32, align 4 
# |               .
# |               .
# |               .
# |            7373:  %51 = extractvalue { i32, i1 } %50, 0 
# |            7374:  %52 = extractvalue { i32, i1 } %50, 1 
# |            7375:  br i1 %52, label %.atomic.exit18, label %.atomic.cont19 
# |            7376:  
# |            7377: .atomic.exit18: ; preds = %.atomic.cont19 
# |            7378:  store i32 %47, ptr %1, align 4 
# | check:2444'0                          {            search range start (exclusive)
# | check:2444'1                                       error: no match found in search range
# | check:2444'2                                       pattern attempts to capture variables: "xval"
# |            7379:  %53 = atomicrmw max ptr %0, i32 %2 monotonic, align 4 
# |            7380:  %54 = call i32 @llvm.smax.i32(i32 %53, i32 %2) 
# | check:2444'3      ?                                                possible intended match
# |            7381:  store i32 %53, ptr %1, align 4 
# |            7382:  %55 = atomicrmw min ptr %0, i32 %2 monotonic, align 4 
# |            7383:  %56 = call i32 @llvm.smin.i32(i32 %55, i32 %2) 
# |            7384:  store i32 %55, ptr %1, align 4 
# |            7385:  %57 = atomicrmw umax ptr %0, i32 %2 monotonic, align 4 
# |               .
# |               .
# |               .
# |            7421: %struct.ident_t = type { i32, i32, i32, i32, ptr } 
# |            7422:  
# |            7423: @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 
# |            7424: @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @0 }, align 8 
# |            7425:  
# |            7426: define void @omp_atomic_capture_misc(ptr %0, ptr %1, i32 %2, ptr %3, ptr %4, float %5) { 
# | check:2444'4                                         }                                                      search range end (exclusive)
# |            7427:  br label %entry 
# |            7428:  
# |            7429: entry: ; preds = %6 
# |            7430:  %7 = atomicrmw xchg ptr %0, i32 %2 monotonic, align 4 
# |            7431:  store i32 %7, ptr %1, align 4 
# |               .
# |               .
# |               .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

### LLVM-Unit
<details>
<summary>LLVM-Unit.Frontend/_/LLVMFrontendTests_exe/OpenMPIRBuilderTest/OMPAtomicUpdateIntr</summary>

```
Script:
--
C:\_work\llvm-project\llvm-project\build\unittests\Frontend\.\LLVMFrontendTests.exe --gtest_filter=OpenMPIRBuilderTest.OMPAtomicUpdateIntr
--
unknown file
SEH exception with code 0x3221225501 thrown in the test body.
Stack trace:



```
</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/215654


More information about the flang-commits mailing list