[llvm] [SPIRV] Lower load/store atomic to OpAtomicLoad/OpAtomicStore (PR #185696)

Viktoria Maximova via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 10:12:23 PDT 2026


================
@@ -24,8 +24,8 @@ let TargetPrefix = "spv" in {
   def int_spv_unref_global : Intrinsic<[], [llvm_any_ty]>;
 
   def int_spv_gep : Intrinsic<[llvm_any_ty], [llvm_i1_ty, llvm_any_ty, llvm_vararg_ty], [ImmArg<ArgIndex<0>>]>;
-  def int_spv_load : Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty, llvm_i16_ty, llvm_i32_ty], [ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>]>;
-  def int_spv_store : Intrinsic<[], [llvm_any_ty, llvm_anyptr_ty, llvm_i16_ty, llvm_i32_ty], [ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>]>;
+  def int_spv_load : Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty, llvm_i16_ty, llvm_i32_ty, llvm_i8_ty], [ImmArg<ArgIndex<1>>, ImmArg<ArgIndex<2>>, ImmArg<ArgIndex<3>>]>;
----------------
vmaksimo wrote:

Just curious, why does this PR choose to extend `spv_load` rather than adding new `spv_load_atomic` intrinsic? Like, at this level we don't want the intrinsics to exactly map to their SPIR-V counterpart?

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


More information about the llvm-commits mailing list