[llvm] [Instrumentor] Improve stub printer (for C/C++ and value packs) (PR #198366)

via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 16:06:50 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 134992 tests passed
* 3321 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### LLVM
<details>
<summary>LLVM.Instrumentation/Instrumentor/generate_rt.ll</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
rm -rf C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp && mkdir -p C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp && cd C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp
# executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp'
# note: command had no output on stdout or stderr
# executed command: mkdir -p 'C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp'
# note: command had no output on stdout or stderr
# executed command: cd 'C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\opt.exe < C:\_work\llvm-project\llvm-project\llvm\test\Instrumentation\Instrumentor\generate_rt.ll -passes=instrumentor -instrumentor-read-config-files=C:\_work\llvm-project\llvm-project\llvm\test\Instrumentation\Instrumentor/rt_config.json -S
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\opt.exe' -passes=instrumentor '-instrumentor-read-config-files=C:\_work\llvm-project\llvm-project\llvm\test\Instrumentation\Instrumentor/rt_config.json' -S
# .---command stdout------------
# | ; ModuleID = '<stdin>'
# | source_filename = "<stdin>"
# | 
# | @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1000, ptr @__instrumentor_ctor, ptr null }]
# | @__instrumentor_.str = private unnamed_addr constant [8 x i8] c"<stdin>\00", align 1
# | @__instrumentor_.str.1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
# | @llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1000, ptr @__instrumentor_dtor, ptr null }]
# | 
# | define private void @__instrumentor_ctor() {
# | entry:
# |   call void @__instrumentor_pre_module(ptr @__instrumentor_.str, ptr @__instrumentor_.str.1, i32 1) #0
# |   ret void
# | }
# | 
# | declare void @__instrumentor_pre_module(ptr, ptr, i32)
# | 
# | define private void @__instrumentor_dtor() {
# | entry:
# |   call void @__instrumentor_post_module(ptr @__instrumentor_.str, ptr @__instrumentor_.str.1, i32 -2) #0
# |   ret void
# | }
# | 
# | declare void @__instrumentor_post_module(ptr, ptr, i32)
# | 
# | attributes #0 = { willreturn }
# `-----------------------------
# .---command stderr------------
# | warning: malformed JSON configuration, expected an object matching an instrumentor choice, got ptrtoint
# | warning: malformed JSON configuration, expected an object matching an instrumentor choice, got ptrtoint
# `-----------------------------
# RUN: at line 3
diff -b default_rt.c C:\_work\llvm-project\llvm-project\llvm\test\Instrumentation\Instrumentor/default_rt.c
# executed command: diff -b default_rt.c 'C:\_work\llvm-project\llvm-project\llvm\test\Instrumentation\Instrumentor/default_rt.c'
# .---command stdout------------
# | *** C:\_work\llvm-project\llvm-project\build\test\Instrumentation\Instrumentor\Output\generate_rt.ll.tmp\default_rt.c
# | --- C:\_work\llvm-project\llvm-project\llvm\test\Instrumentation\Instrumentor/default_rt.c
# | ***************
# | *** 73,83 ****
# |   }
# |   }
# |   
# | - int64_t __instrumentor_pre_alloca(int64_t size, int64_t alignment, int32_t id) {
# | - printf("alloca pre -- size: %" PRId64 ", alignment: %" PRId64 ", id: %" PRId32 "\n", size, alignment, id);
# | - return size;
# | - }
# | - 
# |   void __instrumentor_pre_unreachable(int32_t id) {
# |   printf("unreachable pre -- id: %" PRId32 "\n", id);
# |   }
# | --- 73,78 ----
# | ***************
# | *** 85,90 ****
# | --- 80,90 ----
# |   void *__instrumentor_pre_load(void *pointer, int32_t pointer_as, int64_t value_size, int64_t alignment, int32_t value_type_id, int32_t atomicity_ordering, int8_t sync_scope_id, int8_t is_volatile, int32_t id) {
# |   printf("load pre -- pointer: %p, pointer_as: %" PRId32 ", value_size: %" PRId64 ", alignment: %" PRId64 ", value_type_id: %" PRId32 ", atomicity_ordering: %" PRId32 ", sync_scope_id: %" PRId32 ", is_volatile: %" PRId32 ", id: %" PRId32 "\n", pointer, pointer_as, value_size, alignment, value_type_id, atomicity_ordering, sync_scope_id, is_volatile, id);
# |   return pointer;
# | + }
# | + 
# | + int64_t __instrumentor_pre_alloca(int64_t size, int64_t alignment, int32_t id) {
# | + printf("alloca pre -- size: %" PRId64 ", alignment: %" PRId64 ", id: %" PRId32 "\n", size, alignment, id);
# | + return size;
# |   }
# |   
# |   void *__instrumentor_pre_store(void *pointer, int32_t pointer_as, int64_t value, int64_t value_size, int64_t alignment, int32_t value_type_id, int32_t atomicity_ordering, int8_t sync_scope_id, int8_t is_volatile, int32_t id) {
# | ***************
# | *** 97,107 ****
# |   return pointer;
# |   }
# |   
# | - void *__instrumentor_post_alloca(void *address, int64_t size, int64_t alignment, int32_t id) {
# | - printf("alloca post -- address: %p, size: %" PRId64 ", alignment: %" PRId64 ", id: %" PRId32 "\n", address, size, alignment, id);
# | - return address;
# | - }
# | - 
# |   int64_t __instrumentor_post_load(void *pointer, int32_t pointer_as, int64_t value, int64_t value_size, int64_t alignment, int32_t value_type_id, int32_t atomicity_ordering, int8_t sync_scope_id, int8_t is_volatile, int32_t id) {
# |   printf("load post -- pointer: %p, pointer_as: %" PRId32 ", value: %" PRId64 ", value_size: %" PRId64 ", alignment: %" PRId64 ", value_type_id: %" PRId32 ", atomicity_ordering: %" PRId32 ", sync_scope_id: %" PRId32 ", is_volatile: %" PRId32 ", id: %" PRId32 "\n", pointer, pointer_as, value, value_size, alignment, value_type_id, atomicity_ordering, sync_scope_id, is_volatile, id);
# |   return value;
# | --- 97,102 ----
# | ***************
# | *** 109,114 ****
# | --- 104,114 ----
# |   
# |   void __instrumentor_post_load_ind(void *pointer, int32_t pointer_as, int64_t *value_ptr, int64_t value_size, int64_t alignment, int32_t value_type_id, int32_t atomicity_ordering, int8_t sync_scope_id, int8_t is_volatile, int32_t id) {
# |   printf("load post -- pointer: %p, pointer_as: %" PRId32 ", value: %p, value_size: %" PRId64 ", alignment: %" PRId64 ", value_type_id: %" PRId32 ", atomicity_ordering: %" PRId32 ", sync_scope_id: %" PRId32 ", is_volatile: %" PRId32 ", id: %" PRId32 "\n", pointer, pointer_as, value_ptr, value_size, alignment, value_type_id, atomicity_ordering, sync_scope_id, is_volatile, id);
# | + }
# | + 
# | + void *__instrumentor_post_alloca(void *address, int64_t size, int64_t alignment, int32_t id) {
# | + printf("alloca post -- address: %p, size: %" PRId64 ", alignment: %" PRId64 ", id: %" PRId32 "\n", address, size, alignment, id);
# | + return address;
# |   }
# |   
# |   void __instrumentor_post_store(void *pointer, int32_t pointer_as, int64_t value, int64_t value_size, int64_t alignment, int32_t value_type_id, int32_t atomicity_ordering, int8_t sync_scope_id, int8_t is_volatile, int32_t id) {
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the llvm-commits mailing list