[PATCH] D19523: Symbolize operand bundle blocks for bcanalyzer

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 22:55:46 PDT 2016


sanjoy created this revision.
sanjoy added a reviewer: joker.eph.
sanjoy added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

http://reviews.llvm.org/D19523

Files:
  test/Bitcode/operand-bundles-bc-analyzer.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
@@ -105,6 +105,7 @@
 
   switch (BlockID) {
   default:                             return nullptr;
+  case bitc::OPERAND_BUNDLE_TAGS_BLOCK_ID: return "OPERAND_BUNDLE_TAGS_BLOCK";
   case bitc::MODULE_BLOCK_ID:          return "MODULE_BLOCK";
   case bitc::PARAMATTR_BLOCK_ID:       return "PARAMATTR_BLOCK";
   case bitc::PARAMATTR_GROUP_BLOCK_ID: return "PARAMATTR_GROUP_BLOCK_ID";
@@ -279,6 +280,7 @@
       STRINGIFY_CODE(FUNC_CODE, INST_CALL)
       STRINGIFY_CODE(FUNC_CODE, DEBUG_LOC)
       STRINGIFY_CODE(FUNC_CODE, INST_GEP)
+      STRINGIFY_CODE(FUNC_CODE, OPERAND_BUNDLE)
     }
   case bitc::VALUE_SYMTAB_BLOCK_ID:
     switch (CodeID) {
@@ -364,6 +366,12 @@
     case bitc::USELIST_CODE_DEFAULT: return "USELIST_CODE_DEFAULT";
     case bitc::USELIST_CODE_BB:      return "USELIST_CODE_BB";
     }
+
+  case bitc::OPERAND_BUNDLE_TAGS_BLOCK_ID:
+    switch(CodeID) {
+    default: return nullptr;
+    case bitc::OPERAND_BUNDLE_TAG: return "OPERAND_BUNDLE_TAG";
+    }
   }
 #undef STRINGIFY_CODE
 }
Index: test/Bitcode/operand-bundles-bc-analyzer.ll
===================================================================
--- /dev/null
+++ test/Bitcode/operand-bundles-bc-analyzer.ll
@@ -0,0 +1,27 @@
+; RUN: llvm-as < %s | llvm-bcanalyzer -dump -disable-histogram | FileCheck %s
+
+; CHECK:  <OPERAND_BUNDLE_TAGS_BLOCK
+; CHECK-NEXT:    <OPERAND_BUNDLE_TAG
+; CHECK-NEXT:    <OPERAND_BUNDLE_TAG
+; CHECK-NEXT:    <OPERAND_BUNDLE_TAG
+; CHECK-NEXT:    <OPERAND_BUNDLE_TAG
+; CHECK-NEXT:    <OPERAND_BUNDLE_TAG
+; CHECK-NEXT:  </OPERAND_BUNDLE_TAGS_BLOCK
+
+; CHECK:   <FUNCTION_BLOCK
+; CHECK:    <OPERAND_BUNDLE
+; CHECK:    <OPERAND_BUNDLE
+; CHECK-NOT: <OPERAND_BUNDLE
+; CHECK:  </FUNCTION_BLOCK
+
+; CHECK: Block ID #{{[0-9]+}} (OPERAND_BUNDLE_TAGS_BLOCK)
+
+declare void @callee0()
+
+define void @f0(i32* %ptr) {
+ entry:
+  %l = load i32, i32* %ptr
+  %x = add i32 42, 1
+  call void @callee0() [ "foo"(i32 42, i64 100, i32 %x), "bar"(float  0.000000e+00, i64 100, i32 %l) ]
+  ret void
+}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19523.54966.patch
Type: text/x-patch
Size: 2217 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160426/b9524ceb/attachment.bin>


More information about the llvm-commits mailing list