Page MenuHomePhabricator

[llvm/DebugInfo] Emit DW_OP_implicit_value when tuning for LLDB
ClosedPublic

Authored by mib on Oct 22 2020, 7:26 PM.

Details

Summary

This patch enables emitting DWARF DW_OP_implicit_value opcode when
tuning debug information for LLDB (-debugger-tune=lldb).

This will also propagate to Darwin platforms, since they use LLDB tuning
as a default.

rdar://67406059

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Unit TestsFailed

TimeTest
430 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp
40 mslinux > LLVM.DebugInfo/X86::implicit_value-double.ll
Script: -- : 'RUN: at line 4'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llc -debugger-tune=gdb -filetype=obj /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/X86/implicit_value-double.ll -o - | /mnt/disks/ssd0/agent/llvm-project/build/bin/llvm-dwarfdump - | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/X86/implicit_value-double.ll
40 mslinux > LLVM.DebugInfo/X86::implicit_value-float.ll
Script: -- : 'RUN: at line 4'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llc -debugger-tune=gdb -filetype=obj /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/X86/implicit_value-float.ll -o - | /mnt/disks/ssd0/agent/llvm-project/build/bin/llvm-dwarfdump - | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/X86/implicit_value-float.ll
80 mslinux > LLVM.DebugInfo/X86::stack-value-piece.ll
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/llc /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/X86/stack-value-piece.ll -filetype=obj -o - | /mnt/disks/ssd0/agent/llvm-project/build/bin/llvm-dwarfdump -debug-info -debug-loc - | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/X86/stack-value-piece.ll
80 mswindows > LLVM.DebugInfo/X86::implicit_value-double.ll
Script: -- : 'RUN: at line 4'; c:\ws\w16-1\llvm-project\premerge-checks\build\bin\llc.exe -debugger-tune=gdb -filetype=obj C:\ws\w16-1\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\implicit_value-double.ll -o - | c:\ws\w16-1\llvm-project\premerge-checks\build\bin\llvm-dwarfdump.exe - | c:\ws\w16-1\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w16-1\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\implicit_value-double.ll
View Full Test Results (7 Failed)

Event Timeline

mib created this revision.Oct 22 2020, 7:26 PM
mib requested review of this revision.Oct 22 2020, 7:26 PM
mib updated this revision to Diff 300428.Oct 23 2020, 4:07 PM
aprantl added inline comments.Oct 23 2020, 4:36 PM
llvm/test/DebugInfo/X86/implicit_value-double.ll
14

You probably don't need to duplicate the CHECK lines — also I'm surprised this even works.

Anyway, this LGTM with the tests fixed.

mib updated this revision to Diff 300439.Oct 23 2020, 5:12 PM
mib marked an inline comment as done.

Fix pre-check test failures

aprantl accepted this revision.Oct 23 2020, 5:27 PM
This revision is now accepted and ready to land.Oct 23 2020, 5:27 PM
JDevlieghere accepted this revision.Oct 23 2020, 8:54 PM

LGTM with a few nits.

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
2472–2474
llvm/test/DebugInfo/X86/implicit_value-float.ll
12

Maybe add a negative test for sce?

mib added a comment.EditedOct 23 2020, 9:11 PM

It seems that the HWASAN pre-check test is also failing in D89844 (https://buildkite.com/llvm-project/premerge-checks/builds/14519) ... I also tested on Linux and the test passes so I guess this is an issue with the bot.

$ /usr/bin/python3.7 /Users/docker_user/Developer/open-source/llvm.org/build/Modular/./bin/llvm-lit -svv --filter=TestCases/sizes.cpp -- /Users/docker_user/Developer/open-source/llvm.org/build/Modular/projects/compiler-rt/test/hwasan/X86_64
Testing Time: 5.52s
  Excluded: 50
  Passed  :  1

$ uname -s 
Linux
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
2472–2474

I'm not 100% sure GDB || LLDB <-> !SCE, this is why I put it this way ... What if the -debugger-tune option is not set all ?

mib updated this revision to Diff 300457.Oct 23 2020, 9:44 PM

Add negative test for -debugger-tune=sce.