Skip to content

Debug info for local array of structs through extra stride metadata - #2072

Merged
Tristan Labelle (tristanlabelle) merged 7 commits into
microsoft:debug-info-stagingfrom
tristanlabelle:array-of-structs-debug-info-with-strides
Apr 17, 2019
Merged

Tristan Labelle (tristanlabelle) merged 7 commits into
microsoft:debug-info-stagingfrom
tristanlabelle:array-of-structs-debug-info-with-strides

Conversation

@tristanlabelle

Copy link
Copy Markdown
Contributor

Arrays of structs lose element contiguity when SROA'd into separate arrays of struct elements. This cannot be represented by @llvm.dbg.declare/value and DIExpressions. This change modifies the @llvm.dbg.declare's DIExpression to a bit_piece of only the leading contiguous elements, and tags the call with a new !dx.dbg.varlayout metadata that contains stride information usable by backends to reconstruct the information.

The change only applies to local variables, though is written to be extensible to arguments and globalvariables. There are some difficulties with those however:

  • Arguments have some special logic because aggregates are always passed by pointer whereas other types are passed by value. Allocas are also used temporarily during SROA and only promoted back at the end into Arguments.
  • GlobalVariables cannot have metadata attached in our llvm version :'(.

@AppVeyorBot

Copy link
Copy Markdown

✅ Build DirectXShaderCompiler 1.0.1607 completed (commit 15741379ad by @MrTrillian)

@AppVeyorBot

Copy link
Copy Markdown

❌ Build DirectXShaderCompiler 1.0.1620 failed (commit ec45bd7d03 by @MrTrillian)

@AppVeyorBot

Copy link
Copy Markdown

✅ Build DirectXShaderCompiler 1.0.1623 completed (commit d18113d60a by @MrTrillian)

@AppVeyorBot

Copy link
Copy Markdown

✅ Build DirectXShaderCompiler 1.0.1711 completed (commit 585728be25 by @MrTrillian)

@tristanlabelle
Tristan Labelle (tristanlabelle) changed the base branch from master to debug-info-staging April 17, 2019 19:07
@tristanlabelle

Copy link
Copy Markdown
Contributor Author

Retargeted to debug-info-staging since this includes potential unspec'd DXIL changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants