[llvm] [SPIRV] Add logic for OpGenericCastToPtrExplicit rewriting (PR #146596)

LLVM Continuous Integration via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 07:31:51 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `llvm` at step 6 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/144/builds/29906

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LLVM :: Transforms/InferAddressSpaces/SPIRV/generic-cast-explicit.ll' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt < /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InferAddressSpaces/SPIRV/generic-cast-explicit.ll -passes=infer-address-spaces -S --mtriple=spirv64-unknown-unknown | /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InferAddressSpaces/SPIRV/generic-cast-explicit.ll # RUN: at line 3
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt -passes=infer-address-spaces -S --mtriple=spirv64-unknown-unknown
+ /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InferAddressSpaces/SPIRV/generic-cast-explicit.ll
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt: warning: failed to infer data layout: unable to get target for 'spirv64-unknown-unknown', see --version and --triple.
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/opt: WARNING: failed to create target machine for 'spirv64-unknown-unknown': unable to get target for 'spirv64-unknown-unknown', see --version and --triple.
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InferAddressSpaces/SPIRV/generic-cast-explicit.ll:11:11: error: CHECK: expected string not found in input
 ; CHECK: %b1 = icmp eq ptr addrspace(1) %global, null
          ^
<stdin>:5:45: note: scanning from here
define i1 @kernel1(ptr addrspace(1) %global) {
                                            ^
<stdin>:8:2: note: possible intended match here
 %b1 = icmp eq ptr addrspace(1) %c2, null
 ^

Input file: <stdin>
Check file: /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/test/Transforms/InferAddressSpaces/SPIRV/generic-cast-explicit.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: ; ModuleID = '<stdin>' 
            2: source_filename = "<stdin>" 
            3: target triple = "spirv64-unknown-unknown" 
            4:  
            5: define i1  at kernel1(ptr addrspace(1) %global) { 
check:7                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:11'0                                                 X~~ error: no match found
            6:  %c1 = addrspacecast ptr addrspace(1) %global to ptr addrspace(4) 
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7:  %c2 = call ptr addrspace(1) @llvm.spv.generic.cast.to.ptr.explicit.p1(ptr addrspace(4) %c1) 
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8:  %b1 = icmp eq ptr addrspace(1) %c2, null 
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:11'1      ?                                         possible intended match
            9:  ret i1 %b1 
check:11'0     ~~~~~~~~~~~~
           10: } 
check:11'0     ~~
           11:  
check:11'0     ~
           12: define i1 @kernel2(ptr addrspace(1) %global) { 
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  %c1 = addrspacecast ptr addrspace(1) %global to ptr addrspace(4) 
...

```

</details>

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


More information about the llvm-commits mailing list