diff options
author | Artem Belevich <tra@google.com> | 2024-10-22 13:01:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-22 13:01:40 -0700 |
commit | 020fa86897c0d39d6a806221e330abf901be3cdd (patch) | |
tree | 0890465aa2d50b2428eae5188fb75aec871250a8 /llvm/lib/CodeGen/MachineOperand.cpp | |
parent | f1e59dcb4587fe65837237f780ca55b221726ff3 (diff) | |
download | llvm-020fa86897c0d39d6a806221e330abf901be3cdd.zip llvm-020fa86897c0d39d6a806221e330abf901be3cdd.tar.gz llvm-020fa86897c0d39d6a806221e330abf901be3cdd.tar.bz2 |
[NVPTX] mangle symbols in debug info to conform to PTX restrictions. (#113216)
Until now debug info was printing the symbols names as-is and that
resulted in invalid PTX when the symbols contained characters that are
invalid for PTX. E.g. `__PRETTY_FUNCTION.something`
Debug info is somewhat disconnected from the symbols themselves, so the
regular "NVPTXAssignValidGlobalNames" pass can't easily fix them.
As the "plan B" this patch catches printout of debug symbols and fixes
them, as needed. One gotcha is that the same code path is used to print
the names of debug info sections. Those section names do start with a
'.debug'. The dot in those names is nominally illegal in PTX, but the
debug section names with a dot are accepted as a special case. The
downside of this change is that if someone ever has a `.debug*` symbol
that needs to be referred to from the debug info, that label will be
passed through as-is, and will still produce broken PTX output. If/when
we run into a case where we need it to work, we could consider only
passing through specific debug section names, or add a mechanism
allowing us to tell section names apart from regular symbols.
Fixes #58491
Diffstat (limited to 'llvm/lib/CodeGen/MachineOperand.cpp')
0 files changed, 0 insertions, 0 deletions