[PATCH] D136949: [Debugify] Accumulate the number of variables in debugify metadata

Xiang Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 00:33:04 PST 2022


xiangzhangllvm added inline comments.


================
Comment at: llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir:1
 # RUN: llc -run-pass=mir-debugify,mir-check-debugify %s
 
----------------
asi-sc wrote:
> xiangzhangllvm wrote:
> > It is strange we check nothing, so how to judge this test is pass or not ?
> We do check exit code. As you can see, we remove "xfail" in this patch. So, we had an assertion that is fixed by this patch:
> 
> ```
> asi at asi:~/dev/sources/llvm-project-mainstream/build-release$ bin/llvm-lit ../llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir  -a
> -- Testing: 1 tests, 1 workers --
> XFAIL: LLVM :: CodeGen/Generic/MIRDebugify/multifunction-module.mir (1 of 1)
> Script:
> --
> : 'RUN: at line 1';   /home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc -run-pass=mir-debugify,mir-check-debugify /home/asi/dev/sources/llvm-project-mainstream/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
> --
> Exit Code: 134
> 
> Command Output (stderr):
> --
> + : 'RUN: at line 1'
> + /home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc -run-pass=mir-debugify,mir-check-debugify /home/asi/dev/sources/llvm-project-mainstream/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
> llc: /home/asi/dev/sources/llvm-project-mainstream/llvm/lib/CodeGen/MachineCheckDebugify.cpp:84: virtual bool {anonymous}::CheckDebugMachineModule::runOnModule(llvm::Module&): Assertion `Var <= NumVars && "Unexpected name for DILocalVariable"' failed.
> PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
> Stack dump:
> 0.      Program arguments: /home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc -run-pass=mir-debugify,mir-check-debugify /home/asi/dev/sources/llvm-project-mainstream/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
> 1.      Running pass 'Machine Check Debug Module' on module '/home/asi/dev/sources/llvm-project-mainstream/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir'.
>  #0 0x00005586602463c5 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
>  #1 0x0000558660243ab4 SignalHandler(int) Signals.cpp:0:0
>  #2 0x00007f74926dc520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
>  #3 0x00007f7492730a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
>  #4 0x00007f7492730a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
>  #5 0x00007f7492730a7c pthread_kill ./nptl/pthread_kill.c:89:10
>  #6 0x00007f74926dc476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
>  #7 0x00007f74926c27f3 abort ./stdlib/abort.c:81:7
>  #8 0x00007f74926c271b _nl_load_domain ./intl/loadmsgcat.c:1177:9
>  #9 0x00007f74926d3e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
> #10 0x000055865f25babf (anonymous namespace)::CheckDebugMachineModule::runOnModule(llvm::Module&) MachineCheckDebugify.cpp:0:0
> #11 0x000055865f7e4415 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc+0x5b83415)
> #12 0x000055865d3de27f compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
> #13 0x000055865d3df116 main (/home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc+0x377e116)
> #14 0x00007f74926c3d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
> #15 0x00007f74926c3e40 call_init ./csu/../csu/libc-start.c:128:20
> #16 0x00007f74926c3e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
> #17 0x000055865d3d1a25 _start (/home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc+0x3770a25)
> /home/asi/dev/sources/llvm-project-mainstream/build-release/test/CodeGen/Generic/MIRDebugify/Output/multifunction-module.mir.script: line 1: 11064 Aborted                 (core dumped) /home/asi/dev/sources/llvm-project-mainstream/build-release/bin/llc -run-pass=mir-debugify,mir-check-debugify /home/asi/dev/sources/llvm-project-mainstream/llvm/test/CodeGen/Generic/MIRDebugify/multifunction-module.mir
> ```
> 
> I can precommit the test if you want to run it.
> As for checks, I don't think we must once again check debugify functionality as we already have a few tests targeted it. It should be enough to verify that llc finishes correctly. 
Does this is standard way to check test ? I didn't see this way before.
Not sure the assert is allowed/expected in auto testing tools.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136949/new/

https://reviews.llvm.org/D136949



More information about the llvm-commits mailing list