Page MenuHomePhabricator

[Debuginfo] (8/N) Support for DW_OP_implicit_pointer for named and unnamed variables (second strategy).
Needs ReviewPublic

Authored by alok on Jul 18 2020, 5:14 PM.


This patch stems from D84112.
This patch includes changes for SROA optimization.

Diff Detail

Unit TestsFailed

60 mswindows > LLVM.DebugInfo/NVPTX::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; c:\ws\w64\llvm-project\premerge-checks\build\bin\llc.exe -mtriple=nvptx64-nvidia-cuda < C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\NVPTX\debug-loc-offset.ll | c:\ws\w64\llvm-project\premerge-checks\build\bin\filecheck.exe C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\NVPTX\debug-loc-offset.ll
660 mswindows > LLVM.DebugInfo/X86::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; clang C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\dwarfdump-implicit_pointer_instcomb.c -O2 -gdwarf-5 -o C:\ws\w64\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\dwarfdump-implicit_pointer_instcomb.c.tmp.o
650 mswindows > LLVM.DebugInfo/X86::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; clang C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\dwarfdump-implicit_pointer_mem2reg.c -O2 -gdwarf-5 -o C:\ws\w64\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\dwarfdump-implicit_pointer_mem2reg.c.tmp.o
630 mswindows > LLVM.DebugInfo/X86::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; clang C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\dwarfdump-implicit_pointer_sroa.c -O2 -gdwarf-5 -o C:\ws\w64\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\dwarfdump-implicit_pointer_sroa.c.tmp.o
630 mswindows > LLVM.DebugInfo/X86::Unknown Unit Message ("")
Script: -- : 'RUN: at line 1'; clang C:\ws\w64\llvm-project\premerge-checks\llvm\test\DebugInfo\X86\dwarfdump-implicit_pointer_sroa_inline.c -O2 -gdwarf-5 -o C:\ws\w64\llvm-project\premerge-checks\build\test\DebugInfo\X86\Output\dwarfdump-implicit_pointer_sroa_inline.c.tmp.o

Event Timeline

alok created this revision.Jul 18 2020, 5:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2020, 5:14 PM
jmorse added a subscriber: jmorse.Jul 30 2020, 6:09 AM

I see what seem to be changes to codegen here (see inline comments), is that intentional? And if so, why is that needed for DW_OP_LLVM_explicit_pointer to work?


Why is this now permitted behaviour?


Is this necessary for the implicit pointer work?


Again, this block of code will need comments about its purpose adding.


This part looks like it's changing the code generated, replacing a GEP with an alloca. If that's the case, IMO this should be split out into a different patch (one for codegen, one for debuginfo), as any codegen change will need an independent argument as to why it's a good idea.

Plus, this would only be a codegen change for people building with dwarf-5, which would mean you get different code with and without the -g option to clang.


This should be folded into the previous patch (7?)