[llvm] [SPIRV] Let atomic store store pointers (PR #201251)

Juan Manuel Martinez CaamaƱo via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 01:21:51 PDT 2026


================
@@ -2071,14 +2067,62 @@ bool SPIRVInstructionSelector::selectAtomicStore(MachineInstr &I) const {
   if (MemOp.isVolatile() && STI.getTargetTriple().isVulkanOS())
     MemSem |= static_cast<uint32_t>(SPIRV::MemorySemantics::Volatile);
   Register MemSemReg = buildI32Constant(MemSem | StorageClass, I);
-
   MachineIRBuilder MIRBuilder(I);
+
+  if (PointeeType.isTypePtr()) {
+    if (STI.isPhysicalSPIRV()) {
----------------
jmmartinez wrote:

If it is a pointer type, and it's not physical spirv we should emit a proper error.

```cpp
  if (PointeeType.isTypePtr()) {
    if (!STI.isPhysicalSPIRV())
      return diagnoseUnsupported(I, ...);

    // code that handles the casting.
  }
```

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


More information about the llvm-commits mailing list