This is an archive of the discontinued LLVM Phabricator instance.

[codeview] use S_BPREL32, S_REGREL32, and S_REGISTER records when appropriate
AbandonedPublic

Authored by inglorion on Aug 22 2017, 4:14 PM.

Details

Reviewers
zturner
aprantl
Summary

We used to emit an S_LOCAL record and zero or more S_DEFRANGE* records
for every local variable. This change makes us emit a single S_BPREL32, S_REGREL32,
or S_REGISTER record for variables that can be described that way. This reduces
the size of the generated debug information.

Event Timeline

zturner created this revision.Aug 22 2017, 4:14 PM
inglorion commandeered this revision.Aug 22 2017, 4:37 PM
inglorion edited reviewers, added: zturner; removed: inglorion.
inglorion edited edge metadata.

Thanks!

inglorion updated this revision to Diff 112490.Aug 23 2017, 6:22 PM
inglorion retitled this revision from Emit S_BPREL32 and S_REGREL32 instead of S_DEFRANGE* to WIP: [codeview] use S_BPREL32, S_REGREL32, and S_REGISTER records when appropriate.

I still need to update/add tests.

This shaves about 11 megabytes off the PDB size for opt:
Before: 307,671,040 bytes
After: 295,956,480 bytes

zturner edited edge metadata.Aug 25 2017, 1:29 PM

Unfortunately this seems to have virtually no effect on /DEBUG:FASTLINK PDB size :(. Still good to have anyway since /DEBUG:FULL PDB size is also important, and simpler debug info = better.

inglorion updated this revision to Diff 112988.Aug 28 2017, 4:29 PM
inglorion retitled this revision from WIP: [codeview] use S_BPREL32, S_REGREL32, and S_REGISTER records when appropriate to [codeview] use S_BPREL32, S_REGREL32, and S_REGISTER records when appropriate.
inglorion edited the summary of this revision. (Show Details)
inglorion added a reviewer: aprantl.

I made the change a little more conservative. We now only use the single-record representation
when:

  1. The variable has only a single defrange.
  2. There are no gaps in the defrange.
  3. There S_LOCAL record we would emit would have the default flags.
  4. The defrange does not have a struct offset.

I also updated all the affected tests to expect the new records.

With that, all tests pass and this change is ready for review.

Size numbers with this version:

Without this change: 320,352,256 opt.pdb
With this change: 310,153,216 opt.pdb

Can we ship this?

zturner added inline comments.Aug 30 2017, 11:19 AM
llvm/test/CodeGen/MIR/X86/diexpr-win32.mir
4

Can you inject 5 spaces here so that these line up vertically with the CHECK-NEXT statements?

33–38

Why are we still getting some DefRangeRegisterRel even in 32-bit mode with O0? Ranges should be entire blocks or entire functions, which should make them eligible for BPRelativesym

llvm/test/DebugInfo/COFF/types-array-advanced.ll
53

Any idea where this is coming from? It wasn't here before.

inglorion abandoned this revision.Sep 11 2017, 3:28 PM