[PATCH] D136310: [SPIR-V] Add atomic_flag builtin implementation

Michal Paszkowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 03:05:46 PST 2022


mpaszkowski marked 2 inline comments as done.
mpaszkowski added inline comments.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp:438-440
+  unsigned Semantics =
+      getSPIRVMemSemantics(Order) |
+      getMemSemanticsForStorageClass(GR->getPointerStorageClass(PtrRegister));
----------------
arsenm wrote:
> Why is this something that would be materialized in a register instead of an immediate argument?
This is the way it is done by the Khronos LLVM SPIR-V Translator and we want the SPIR-V backend to be compatible.

Translator:

```
4 Constant 2 14 42 
...
7 AtomicUMin 2 30 4 12 13 14 
```

Backend:

```
%10 = OpConstant %4 42 
...	
%30 = OpAtomicUMin %4 %18 %12 %13 %10
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136310/new/

https://reviews.llvm.org/D136310



More information about the llvm-commits mailing list