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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 15:43:14 PST 2022


arsenm requested changes to this revision.
arsenm added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp:649-652
+  if (Opcode == SPIRV::OpAtomicFlagClear)
+    assert((Semantics != SPIRV::MemorySemantics::Acquire &&
+            Semantics != SPIRV::MemorySemantics::AcquireRelease) &&
+           "Invalid memory order argument!");
----------------
iliya-diyachkov wrote:
> Move the if condition to the assertion.
Agree


================
Comment at: llvm/test/CodeGen/SPIRV/transcoding/atomic_flag.ll:20
+
+define dso_local spir_kernel void @testAtomicFlag(i32 addrspace(1)* nocapture noundef %res) {
+entry:
----------------
Should use opaque pointers in new tests 


================
Comment at: llvm/test/CodeGen/SPIRV/transcoding/atomic_flag.ll:23
+  %f = alloca i32, align 4
+  %0 = bitcast i32* %f to i8*
+  call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %0)
----------------
Use named values in tests


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136310



More information about the llvm-commits mailing list