Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep unmangled fully qualified function name in cir.func #824

Open
keryell opened this issue Sep 6, 2024 · 4 comments
Open

Keep unmangled fully qualified function name in cir.func #824

keryell opened this issue Sep 6, 2024 · 4 comments

Comments

@keryell
Copy link
Contributor

keryell commented Sep 6, 2024

CIR code with a lot of functions is difficult to read & debug because of the mangling names.
If the unmangled fully qualified function name is an attribute of cir.func, it can be displayed in IDE/editors for example by a hoover with usual LSP tooling.

@bcardosolopes
Copy link
Member

I usually pipe the output into c++-filt but I can also see that being handy. Perhaps we could implement that by using an optional attribute and linking that to the presence of some new cc1 compiler flag (or perhaps when -g is present, or something like that).

@keryell
Copy link
Contributor Author

keryell commented Oct 7, 2024

Ouch, actually C++filt is liberal enough to process an MLIR file reasonably well. 🤯.
We need an MLIR version adding "" around symbols because my LSP server chokes on @aie::tile<1, 4> aie::device<(aie::$_0)42>::tile<1, 4>() but seems ok with @"aie::tile<1, 4> aie::device<(aie::$_0)42>::tile<1, 4>()". 😄

@bcardosolopes
Copy link
Member

LLVM has llvm-cxxfilt which seems to be almost identical cmdline interface, perhaps that would be an extension LLVM project would be willing to accept? (Like an extra knob to quote the symbols)

@keryell
Copy link
Contributor Author

keryell commented Oct 10, 2024

LLVM has llvm-cxxfilt which seems to be almost identical cmdline interface, perhaps that would be an extension LLVM project would be willing to accept? (Like an extra knob to quote the symbols)

This looks like a great idea and it looks like it even works 😄 llvm/llvm-project#111871
The main issue I hit was the case with module-level allocation where some symbols are already quoted between "" I had to handle to avoid double-quoting.

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

No branches or pull requests

2 participants