[clang] [llvm] [OpenMP] Fix non-contiguous array omp target update (PR #156889)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 04:24:36 PDT 2026


github-actions[bot] wrote:

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

* 53376 tests passed
* 1043 tests skipped
* 2 tests failed

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

### Clang
<details>
<summary>Clang.OpenMP/target_update_count_expression_codegen.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fopenmp -fopenmp-enable-irbuilder -x c -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c -o -  | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --allow-unused-prefixes C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fopenmp -fopenmp-enable-irbuilder -x c -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm 'C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' --allow-unused-prefixes 'C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c:62:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: store i64 1, ptr [[TMP9]], align 8
# |                ^
# | <stdin>:41:78: note: scanning from here
# |  %9 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %7, i32 0, i32 1
# |                                                                              ^
# | <stdin>:41:78: note: with "TMP9" equal to "%9"
# |  %9 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %7, i32 0, i32 1
# |                                                                              ^
# | <stdin>:42:2: note: possible intended match here
# |  store i64 4, ptr %9, align 8
# |  ^
# | C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c:87:66: error: undefined variable: GLOB1
# | // CHECK-NEXT: call void @__tgt_target_data_update_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP3]], ptr [[TMP4]], ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null)
# |                                                                  ^
# | <stdin>:69:73: note: with "TMP3" equal to "%3"
# |  %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0
# |                                                                         ^
# | <stdin>:69:73: note: with "TMP4" equal to "%4"
# |  %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0
# |                                                                         ^
# | <stdin>:70:2: note: possible intended match here
# |  call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 1, ptr %3, ptr %4, ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null)
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_count_expression_codegen.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           36:  %6 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %3, i32 0, i32 2 
# |           37:  store i64 8, ptr %6, align 8 
# |           38:  %7 = getelementptr inbounds [2 x %struct.descriptor_dim], ptr %dims, i64 0, i64 1 
# |           39:  %8 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %7, i32 0, i32 0 
# |           40:  store i64 0, ptr %8, align 8 
# |           41:  %9 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %7, i32 0, i32 1 
# | next:62'0                                                                                  X error: no match found
# | next:62'1                                                                                    with "TMP9" equal to "%9"
# |           42:  store i64 4, ptr %9, align 8 
# | next:62'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:62'2      ?                             possible intended match
# |           43:  %10 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %7, i32 0, i32 2 
# | next:62'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           44:  store i64 1, ptr %10, align 8 
# | next:62'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           45:  %11 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:62'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           46:  store ptr %dims, ptr %11, align 8 
# | next:62'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           47:  %12 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 
# | next:62'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# |           64:  %1 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# |           65:  store ptr @data, ptr %1, align 8 
# |           66:  %2 = getelementptr inbounds [1 x ptr], ptr %.offload_mappers, i64 0, i64 0 
# |           67:  store ptr null, ptr %2, align 8 
# |           68:  %3 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 
# |           69:  %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:87'0                                                                             X error: match failed for invalid pattern
# | next:87'1                                                                               undefined variable: GLOB1
# | next:87'2                                                                               with "TMP3" equal to "%3"
# | next:87'3                                                                               with "TMP4" equal to "%4"
# |           70:  call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 1, ptr %3, ptr %4, ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null) 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:87'4      ?                                                                                                                                                       possible intended match
# |           71:  ret void 
# | next:87'0     ~~~~~~~~~~
# |           72: } 
# | next:87'0     ~~
# |           73:  
# | next:87'0     ~
# |           74: attributes #0 = { noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           75: attributes #1 = { nounwind } 
# | next:87'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            .
# |            .
# |            .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.OpenMP/target_update_variable_stride_codegen.c</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 3
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\23\include -nostdsysteminc -fopenmp -x c -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c -o -  | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --allow-unused-prefixes C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\23\include' -nostdsysteminc -fopenmp -x c -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm 'C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' --allow-unused-prefixes 'C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c:70:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: store i64 1, ptr [[TMP12]], align 8
# |                ^
# | <stdin>:47:80: note: scanning from here
# |  %12 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %10, i32 0, i32 1
# |                                                                                ^
# | <stdin>:47:80: note: with "TMP12" equal to "%12"
# |  %12 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %10, i32 0, i32 1
# |                                                                                ^
# | <stdin>:50:2: note: possible intended match here
# |  store i64 1, ptr %13, align 8
# |  ^
# | C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c:108:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: store i64 1, ptr [[TMP12]], align 8
# |                ^
# | <stdin>:88:82: note: scanning from here
# |  %12 = getelementptr inbounds nuw %struct.descriptor_dim.0, ptr %10, i32 0, i32 1
# |                                                                                  ^
# | <stdin>:88:82: note: with "TMP12" equal to "%12"
# |  %12 = getelementptr inbounds nuw %struct.descriptor_dim.0, ptr %10, i32 0, i32 1
# |                                                                                  ^
# | <stdin>:91:2: note: possible intended match here
# |  store i64 1, ptr %13, align 8
# |  ^
# | C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c:133:66: error: undefined variable: GLOB1
# | // CHECK-NEXT: call void @__tgt_target_data_update_mapper(ptr @[[GLOB1]], i64 -1, i32 1, ptr [[TMP3]], ptr [[TMP4]], ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null)
# |                                                                  ^
# | <stdin>:113:73: note: with "TMP3" equal to "%3"
# |  %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0
# |                                                                         ^
# | <stdin>:113:73: note: with "TMP4" equal to "%4"
# |  %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0
# |                                                                         ^
# | <stdin>:114:2: note: possible intended match here
# |  call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 1, ptr %3, ptr %4, ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null)
# |  ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\OpenMP\target_update_variable_stride_codegen.c
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             .
# |             .
# |             .
# |            42:  %9 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %6, i32 0, i32 2 
# |            43:  store i64 %2, ptr %9, align 8 
# |            44:  %10 = getelementptr inbounds [2 x %struct.descriptor_dim], ptr %dims, i64 0, i64 1 
# |            45:  %11 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %10, i32 0, i32 0 
# |            46:  store i64 0, ptr %11, align 8 
# |            47:  %12 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %10, i32 0, i32 1 
# | next:70'0                                                                                     X error: no match found
# | next:70'1                                                                                       with "TMP12" equal to "%12"
# |            48:  store i64 4, ptr %12, align 8 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            49:  %13 = getelementptr inbounds nuw %struct.descriptor_dim, ptr %10, i32 0, i32 2 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            50:  store i64 1, ptr %13, align 8 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:70'2       ?                              possible intended match
# |            51:  %14 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            52:  store ptr %dims, ptr %14, align 8 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            53:  %15 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            54:  %16 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            55:  call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 1, ptr %15, ptr %16, ptr @.offload_sizes, ptr @.offload_maptypes, ptr null, ptr null) 
# | next:70'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |            83:  %9 = getelementptr inbounds nuw %struct.descriptor_dim.0, ptr %6, i32 0, i32 2 
# |            84:  store i64 %2, ptr %9, align 8 
# |            85:  %10 = getelementptr inbounds [2 x %struct.descriptor_dim.0], ptr %dims, i64 0, i64 1 
# |            86:  %11 = getelementptr inbounds nuw %struct.descriptor_dim.0, ptr %10, i32 0, i32 0 
# |            87:  store i64 0, ptr %11, align 8 
# |            88:  %12 = getelementptr inbounds nuw %struct.descriptor_dim.0, ptr %10, i32 0, i32 1 
# | next:108'0                                                                                      X error: no match found
# | next:108'1                                                                                        with "TMP12" equal to "%12"
# |            89:  store i64 4, ptr %12, align 8 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            90:  %13 = getelementptr inbounds nuw %struct.descriptor_dim.0, ptr %10, i32 0, i32 2 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            91:  store i64 1, ptr %13, align 8 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:108'2      ?                              possible intended match
# |            92:  %14 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            93:  store ptr %dims, ptr %14, align 8 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            94:  %15 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            95:  %16 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            96:  call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 1, ptr %15, ptr %16, ptr @.offload_sizes.1, ptr @.offload_maptypes.2, ptr null, ptr null) 
# | next:108'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# |           108:  %1 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# |           109:  store ptr @data, ptr %1, align 8 
# |           110:  %2 = getelementptr inbounds [1 x ptr], ptr %.offload_mappers, i64 0, i64 0 
# |           111:  store ptr null, ptr %2, align 8 
# |           112:  %3 = getelementptr inbounds [1 x ptr], ptr %.offload_baseptrs, i32 0, i32 0 
# |           113:  %4 = getelementptr inbounds [1 x ptr], ptr %.offload_ptrs, i32 0, i32 0 
# | next:133'0                                                                             X error: match failed for invalid pattern
# | next:133'1                                                                               undefined variable: GLOB1
# | next:133'2                                                                               with "TMP3" equal to "%3"
# | next:133'3                                                                               with "TMP4" equal to "%4"
# |           114:  call void @__tgt_target_data_update_mapper(ptr @1, i64 -1, i32 1, ptr %3, ptr %4, ptr @.offload_sizes.3, ptr @.offload_maptypes.4, ptr null, ptr null) 
# | next:133'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:133'4      ?                                                                                                                                                       possible intended match
# |           115:  ret void 
# | next:133'0     ~~~~~~~~~~
# |           116: } 
# | next:133'0     ~~
# |           117:  
# | next:133'0     ~
# |           118: attributes #0 = { noinline nounwind optnone "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" } 
# | next:133'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           119: attributes #1 = { nounwind } 
# | next:133'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# 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/156889


More information about the llvm-commits mailing list