Skip to content

Conversation

@Lunderberg
Copy link
Contributor

Prior to this commit, the CodeGenLLVM would include DWARF symbols specifying the function signature of each TIR function. This commit expands the information exposed in the debug symbols.

  • Name functions based on the name of the corresponding TIR function. This is taken either from the attr::kGlobalSymbol if present, or the PrimFunc's GlobalVar otherwise.

  • Name function parameter based on their TIR variable name.

  • Annotate the name, the type signature, and parameter names for the private function produced by the tir::attr::compute_scope attribute.

  • Name local variables based on the name and type of the corresponding TIR variable.

Prior to this commit, the `CodeGenLLVM` would include DWARF symbols
specifying the function signature of each TIR function.  This commit
expands the information exposed in the debug symbols.

* Name functions based on the name of the corresponding TIR function.
  This is taken either from the `attr::kGlobalSymbol` if present,
  or the PrimFunc's `GlobalVar` otherwise.

* Name function parameter based on their TIR variable name.

* Annotate the name, the type signature, and parameter names for the
  private function produced by the `tir::attr::compute_scope`
  attribute.

* Name local variables based on the name and type of the corresponding
  TIR variable.
@Lunderberg
Copy link
Contributor Author

This came about while debugging the implementation of #16542, but is otherwise unrelated.

@Lunderberg
Copy link
Contributor Author

Merged from main to PR branch, to resolve CI breakage that was fixed in #16546.

Copy link
Contributor

@slyubomirsky slyubomirsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm all for propagating more debug information and I don't see anything to take issue with here.

@Lunderberg Lunderberg merged commit bde28ae into apache:main Feb 23, 2024
@Lunderberg Lunderberg deleted the llvm_expanded_debug_symbols branch February 23, 2024 14:05
PhilippvK pushed a commit to PhilippvK/tvm that referenced this pull request Jun 4, 2024
* [TIR] Expand debug symbol output for CodeGenLLVM

Prior to this commit, the `CodeGenLLVM` would include DWARF symbols
specifying the function signature of each TIR function.  This commit
expands the information exposed in the debug symbols.

* Name functions based on the name of the corresponding TIR function.
  This is taken either from the `attr::kGlobalSymbol` if present,
  or the PrimFunc's `GlobalVar` otherwise.

* Name function parameter based on their TIR variable name.

* Annotate the name, the type signature, and parameter names for the
  private function produced by the `tir::attr::compute_scope`
  attribute.

* Name local variables based on the name and type of the corresponding
  TIR variable.

* lint fixes

* lint fixes

* Remove reference to llvm::dwarf::DWARF_VERSION

Not available on CI version of llvm

* Update number of debug locations

* Fix segfault for pointers to custom data types
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.

2 participants