[llvm] Use `FUNC_CODE_INST_ATOMICRMW_OLD` legacy code for bitcode writer. (PR #219277)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 16:54:28 PDT 2026
================
@@ -0,0 +1,24 @@
+; RUN: llc --filetype=obj %s --stop-after=dxil-write-bitcode -o %t.bc
+; RUN: llvm-bcanalyzer --dump --non-symbolic --disable-histogram %t.bc | \
+; RUN: FileCheck %s --check-prefix=BITCODE
+; RUN: llvm-dis %t.bc -o - | FileCheck %s --check-prefix=LLVM
+
+; Verify that DXIL uses atomicrmw record code 38, which the LLVM reader
+; supports.
+
+target triple = "dxil-pc-shadermodel6.0-compute"
+
+ at gsm = internal addrspace(3) global i32 zeroinitializer, align 4
+
+; LLVM-LABEL: define void @main()
+; LLVM: atomicrmw add ptr addrspace(3) @gsm, i32 1 monotonic
+; BITCODE-LABEL: <FUNCTION_BLOCK
+; BITCODE: <UnknownCode38
----------------
bogner wrote:
Should we update [GetCodeName() in BitcodeAnalyzer.cpp](https://github.com/llvm/llvm-project/blob/main/llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp#L269) to handle `INST_ATOMICRMW_OLD`?
https://github.com/llvm/llvm-project/pull/219277
More information about the llvm-commits
mailing list