[llvm] [InferAddressSpaces] Infer pointer stored and then loaded from global variable (PR #159755)

via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 24 04:49:57 PST 2025


github-actions[bot] wrote:

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

* 128943 tests passed
* 2842 tests skipped
* 3 tests failed

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

### LLVM
<details>
<summary>LLVM.Transforms/InferAddressSpaces/AMDGPU/builtin-assumed-addrspace.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S -mtriple=amdgcn-amd-amdhsa -passes=infer-address-spaces -o - C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\builtin-assumed-addrspace.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\builtin-assumed-addrspace.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -mtriple=amdgcn-amd-amdhsa -passes=infer-address-spaces -o - 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\builtin-assumed-addrspace.ll'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\builtin-assumed-addrspace.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\builtin-assumed-addrspace.ll:279:15: error: CHECK-NEXT: is not on the line after the previous match
# | ; CHECK-NEXT: [[GEP:%.*]] = getelementptr inbounds float, ptr addrspace(3) [[TMP1]], i64 [[IDXPROM]]
# |               ^
# | <stdin>:152:2: note: 'next' match was here
# |  %gep = getelementptr inbounds float, ptr addrspace(3) %1, i64 %idxprom
# |  ^
# | <stdin>:150:47: note: previous match ended here
# |  %1 = addrspacecast ptr %p to ptr addrspace(3)
# |                                               ^
# | <stdin>:151:1: note: non-matching line after previous match is here
# |  %2 = getelementptr inbounds float, ptr %p, i64 %idxprom
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\builtin-assumed-addrspace.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           .
# |           .
# |           .
# |         147:  tail call void @llvm.assume(i1 %is.shared) 
# |         148:  %workitem.id.x = tail call i32 @llvm.amdgcn.workitem.id.x() 
# |         149:  %idxprom = zext i32 %workitem.id.x to i64 
# |         150:  %1 = addrspacecast ptr %p to ptr addrspace(3) 
# |         151:  %2 = getelementptr inbounds float, ptr %p, i64 %idxprom 
# |         152:  %gep = getelementptr inbounds float, ptr addrspace(3) %1, i64 %idxprom 
# | next:279      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  error: match on wrong line
# |         153:  %is.private = call i1 @llvm.amdgcn.is.private(ptr %2) 
# |         154:  tail call void @llvm.assume(i1 false) 
# |         155:  %load = load float, ptr addrspace(3) %gep, align 4 
# |         156:  ret float %load 
# |         157: } 
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/InferAddressSpaces/AMDGPU/phinode-address-infer.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -S -passes='require<domtree>,infer-address-spaces' C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -S '-passes=require<domtree>,infer-address-spaces' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll:9:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[PTR_1]] to ptr addrspace(3)
# |               ^
# | <stdin>:8:42: note: scanning from here
# |  %ptr.1 = load ptr, ptr %lhs_ptr, align 8
# |                                          ^
# | <stdin>:8:42: note: with "PTR_1" equal to "%ptr.1"
# |  %ptr.1 = load ptr, ptr %lhs_ptr, align 8
# |                                          ^
# | <stdin>:11:4: note: possible intended match here
# |  %ptr.2 = load ptr, ptr %rhs_ptr, align 8
# |    ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |           1: ; ModuleID = 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\AMDGPU\phinode-address-infer.ll' 
# |           2: source_filename = "C:\\_work\\llvm-project\\llvm-project\\llvm\\test\\Transforms\\InferAddressSpaces\\AMDGPU\\phinode-address-infer.ll" 
# |           3: target datalayout = "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9" 
# |           4: target triple = "amdgcn-amd-amdhsa" 
# |           5:  
# |           6: define void @test(ptr %lhs_ptr, ptr %rhs_ptr) #0 { 
# |           7: entry: 
# |           8:  %ptr.1 = load ptr, ptr %lhs_ptr, align 8 
# | next:9'0                                              X error: no match found
# | next:9'1                                                with "PTR_1" equal to "%ptr.1"
# |           9:  %bool.1 = tail call i1 @llvm.amdgcn.is.shared(ptr %ptr.1) 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          10:  tail call void @llvm.assume(i1 %bool.1) 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          11:  %ptr.2 = load ptr, ptr %rhs_ptr, align 8 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:9'2        ?                                       possible intended match
# |          12:  %bool.2 = tail call i1 @llvm.amdgcn.is.shared(ptr %ptr.2) 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          13:  tail call void @llvm.assume(i1 %bool.2) 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          14:  br i1 poison, label %if.then, label %if.else 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          15:  
# | next:9'0     ~
# |          16: if.then: ; preds = %entry 
# | next:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           .
# |           .
# |           .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>LLVM.Transforms/InferAddressSpaces/NVPTX/phinode-address-infer.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe -S -mtriple=nvptx64-nvidia-cuda -passes='require<domtree>,infer-address-spaces' C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\NVPTX\phinode-address-infer.ll | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\NVPTX\phinode-address-infer.ll
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -S -mtriple=nvptx64-nvidia-cuda '-passes=require<domtree>,infer-address-spaces' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\NVPTX\phinode-address-infer.ll'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\NVPTX\phinode-address-infer.ll'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\NVPTX\phinode-address-infer.ll:15:15: error: CHECK-NEXT: expected string not found in input
# | ; CHECK-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[PTR_1]] to ptr addrspace(3)
# |               ^
# | <stdin>:17:38: note: scanning from here
# |  %ptr.1 = load ptr, ptr null, align 8
# |                                      ^
# | <stdin>:17:38: note: with "PTR_1" equal to "%ptr.1"
# |  %ptr.1 = load ptr, ptr null, align 8
# |                                      ^
# | <stdin>:18:28: note: possible intended match here
# |  %bool.1 = tail call i1 @llvm.nvvm.isspacep.shared(ptr %ptr.1)
# |                            ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\llvm\test\Transforms\InferAddressSpaces\NVPTX\phinode-address-infer.ll
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |           12: ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) 
# |           13: declare i1 @llvm.nvvm.isspacep.global(ptr captures(none)) #1 
# |           14:  
# |           15: define void @phinode_instr() { 
# |           16: entry: 
# |           17:  %ptr.1 = load ptr, ptr null, align 8 
# | next:15'0                                          X error: no match found
# | next:15'1                                            with "PTR_1" equal to "%ptr.1"
# |           18:  %bool.1 = tail call i1 @llvm.nvvm.isspacep.shared(ptr %ptr.1) 
# | next:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | next:15'2                                ?                                    possible intended match
# |           19:  tail call void @llvm.assume(i1 %bool.1) 
# | next:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           20:  br label %if.sink.split 
# | next:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
# |           21:  
# | next:15'0     ~
# |           22: if.sink.split: ; preds = %entry 
# | next:15'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |           23:  %ptr.sink = phi ptr [ %ptr.1, %entry ] 
# | next:15'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/159755


More information about the llvm-commits mailing list