[PATCH] D52354: Fix some missing opcodes in bcanalyzer
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 21 05:11:29 PDT 2018
arsenm created this revision.
arsenm added a reviewer: tejohnson.
Herald added subscribers: Szelethus, jfb, a.sidorin, wdng.
Herald added a reviewer: george.karpenkov.
https://reviews.llvm.org/D52354
Files:
test/Bitcode/bcanalyzer-atomics.ll
tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
Index: tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
===================================================================
--- tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
+++ tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp
@@ -285,6 +285,11 @@
STRINGIFY_CODE(FUNC_CODE, DEBUG_LOC)
STRINGIFY_CODE(FUNC_CODE, INST_GEP)
STRINGIFY_CODE(FUNC_CODE, OPERAND_BUNDLE)
+ STRINGIFY_CODE(FUNC_CODE, INST_FENCE)
+ STRINGIFY_CODE(FUNC_CODE, INST_ATOMICRMW)
+ STRINGIFY_CODE(FUNC_CODE, INST_LOADATOMIC)
+ STRINGIFY_CODE(FUNC_CODE, INST_STOREATOMIC)
+ STRINGIFY_CODE(FUNC_CODE, INST_CMPXCHG)
}
case bitc::VALUE_SYMTAB_BLOCK_ID:
switch (CodeID) {
Index: test/Bitcode/bcanalyzer-atomics.ll
===================================================================
--- /dev/null
+++ test/Bitcode/bcanalyzer-atomics.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llvm-bcanalyzer -dump | FileCheck %s
+; Make sure the names of atomics are known
+
+; CHECK: INST_CMPXCHG
+; CHECK: INST_STOREATOMIC
+; CHECK: INST_LOADATOMIC
+; CHECK: INST_FENCE
+define void @atomics(i32* %ptr) {
+ store atomic i32 0, i32* %ptr monotonic, align 4
+ %load = load atomic i32, i32* %ptr monotonic, align 4
+ %xchg = cmpxchg i32* %ptr, i32 0, i32 5 acquire monotonic
+ fence seq_cst
+ ret void
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52354.166457.patch
Type: text/x-patch
Size: 1295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180921/7a83058d/attachment.bin>
More information about the llvm-commits
mailing list