<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/95749>95749</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [SPIR-V] OpenCL CTS c11_atomics atomic_init long test failure, load instruction type mismatch
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:SPIR-V
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          michalpaszkowski
      </td>
    </tr>
</table>

<pre>
    ```
michalpaszkowski@mpaszkow-desktop:~/TestSuites/OpenCL-CTS/build/test_conformance/c11_atomics/bin$ ./test_c11_atomics atomic_init
 Initializing random seed to 0.
Requesting Default device based on command line for platform index 0 and device index 0
Compute Device Name = Intel(R) Graphics [0xa780], Compute Device Vendor = Intel(R) Corporation, Compute Device Version = OpenCL 3.0 NEO , CL C Version = OpenCL C 1.2 
Device latest conformance version passed: v2022-04-22-00
Supports single precision denormals: YES
sizeof( void*) = 8  (host)
sizeof( void*) = 8 (device)
atomic_init...
        local atomic_int...
                (thread count 512, group size 512)
        local atomic_int used in function...
                (thread count 512, group size 512)
        local atomic_int used in generic function...
                (thread count 512, group size 512)
        local atomic_int declared in program...
                (thread count 512, group size 512)
        local atomic_int declared in program, used in function...
                (thread count 512, group size 512)
        local atomic_int declared in program, used in generic function...
                (thread count 512, group size 512)
        global atomic_int...
                (thread count 1024, group size 512)
        global atomic_int used in function...
                (thread count 1024, group size 512)
        global atomic_int used in generic function...
                (thread count 1024, group size 512)
        global atomic_int declared in program...
                (thread count 1024, group size 512)
        global atomic_int declared in program, used in function...
                (thread count 1024, group size 512)
        global atomic_int declared in program, used in generic function...
                (thread count 1024, group size 512)
        local atomic_uint...
                (thread count 512, group size 512)
        local atomic_uint used in function...
                (thread count 512, group size 512)
        local atomic_uint used in generic function...
                (thread count 512, group size 512)
        local atomic_uint declared in program...
                (thread count 512, group size 512)
        local atomic_uint declared in program, used in function...
                (thread count 512, group size 512)
        local atomic_uint declared in program, used in generic function...
                (thread count 512, group size 512)
        global atomic_uint...
                (thread count 1024, group size 512)
        global atomic_uint used in function...
                (thread count 1024, group size 512)
        global atomic_uint used in generic function...
                (thread count 1024, group size 512)
        global atomic_uint declared in program...
                (thread count 1024, group size 512)
        global atomic_uint declared in program, used in function...
                (thread count 1024, group size 512)
        global atomic_uint declared in program, used in generic function...
                (thread count 1024, group size 512)
        local atomic_long...
test_c11_atomics: /home/michalpaszkowski/Driver/igc/build/IGC/llvm-deps/src/llvm/lib/IR/Instructions.cpp:1393: llvm::LoadInst::LoadInst(llvm::Type*, llvm::Value*, const llvm::Twine&, bool, llvm::Align, llvm::AtomicOrdering, llvm::SyncScope::ID, llvm::Instruction*): Assertion `Ty == cast<PointerType>(Ptr->getType())->getElementType()' failed.
Aborted (core dumped)
```

Most recent dumps (likely from the failing subtest):
```
-rw-rw-r-- 1 michalpaszkowski michalpaszkowski  2940 2024-06-17 00:39:08.960613206 -0700 OCL_asm77dca5794ae1b6fb_1_compiler_input_.spv
-rw-rw-r-- 1 michalpaszkowski michalpaszkowski  6006 2024-06-17 00:39:08.964613245 -0700 OCL_asm77dca5794ae1b6fb_2_spirv_backend_input_opaque.ll
-rw-rw-r-- 1 michalpaszkowski michalpaszkowski 15748 2024-06-17 00:39:08.964613245 -0700 OCL_asm77dca5794ae1b6fb_2_spirv_backend_alternative_input_typed.ll
-rw-rw-r-- 1 michalpaszkowski michalpaszkowski  2948 2024-06-17 00:39:08.972613325 -0700 OCL_asm77dca5794ae1b6fb_3_spirv_backend_output.spv
```
Dumps:
[test_c11_atomic_5502.zip](https://github.com/user-attachments/files/15863715/test_c11_atomic_5502.zip)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8WM1u2zoWfhp6Q9igKMmSF164dnwRIHNTJEGBWRkUeSxzQpG6_HGbLObZLyipceK0TZPGAQQJIs8_P33iIXNO1hpgjvJPKF-NWPA7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