This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Don't turn dbg.declare into DBG_VALUE for static allocas
ClosedPublic

Authored by rnk on Jul 31 2017, 3:08 PM.

Details

Summary

We already have information about static alloca stack locations in our
side table. Emitting instructions for them is inefficient, and it only
happens when the address of the alloca has been materialized within the
current block, which isn't often.

Event Timeline

rnk created this revision.Jul 31 2017, 3:08 PM
aprantl edited edge metadata.Jul 31 2017, 4:05 PM

Code LGTM, I have some comments for the testcases inline.

llvm/test/DebugInfo/WebAssembly/dbg-declare.ll
4

When removing the check for the DEBUG_VALUE, could you add a check for the actual variable location being emitted via the MMI side table? llc -filetype=obj | llvm-dwarfdump - and a check for a DW_AT_name / DW_AT_location pair should do the trick.

llvm/test/DebugInfo/X86/dbg-declare-alloca.ll
8

I would prefer something that checks the dwarf or assembler output for an actual debug location to avoid future bitrot.

32

We usually strip out all non-essential attributes. (Usually at least everything in quotes :-)

llvm/test/DebugInfo/X86/dbg-declare.ll
7

ditto here, checking that we still emit the location would be even better

rnk marked 3 inline comments as done.Aug 1 2017, 10:47 AM
rnk added inline comments.
llvm/test/DebugInfo/WebAssembly/dbg-declare.ll
4

llvm-dwarfdump doesn't appear to know how to parse wasm object files, so I can't add that check. I can add the DW_AT_location checks to the other tests, though.

aprantl added inline comments.Aug 1 2017, 10:52 AM
llvm/test/DebugInfo/WebAssembly/dbg-declare.ll
4

Sorry, I overlooked that this was WebAssembly. Makes sense, thanks!

rnk updated this revision to Diff 109157.Aug 1 2017, 10:54 AM
  • add more fbreg dwarfdump tests
aprantl accepted this revision.Aug 1 2017, 11:38 AM
This revision is now accepted and ready to land.Aug 1 2017, 11:38 AM
This revision was automatically updated to reflect the committed changes.