-
Notifications
You must be signed in to change notification settings - Fork 100
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
add names to generated IR #969
Comments
@lanza and I have discussed this too. This will also be pretty important in the future when we want to start running some original CodeGen tests with ClangIR, since they assume value names will be present. From what I understand, MLIR doesn't have the concept of value names the same way LLVM does; they're not stored in the bitcode format, for example, and just generated by the AsmPrinter on the fly instead. We'll probably need to extend the LLVMIR dialect to support this; one idea we were thinking of was an optional attribute on all operations to name the result (similar to how |
Beside SSA value names, what about basic block names? MLIR does not support block names either. |
Good point, I'd forgotten about those. I'm not sure at all about the right approach for those, but hopefully the MLIR folks will have ideas. |
One interesting bit is that operations with multiple return values actually get names based on tablegen, so some of the mechanism is already there. This discussion has happened in MLIR related forums before, I don't have a digest to give, but it might be worth asking there to get an informed status quo |
I found some relevant reading: https://discourse.llvm.org/t/rfc-better-support-for-dialects-that-want-to-make-ssa-names-load-bearing/674 and https://discourse.llvm.org/t/names-in-ssa-values-for-debuggability/1041. In particular llvm/llvm-project@596da62 actually landed, but I'm not sure what the API looks like in practice. |
Haven't looked in depth, but seems like it requires changing the printers to custom ones? This is from 2020, so maybe there's something more streamlined we could use? |
Now when we generate IR from CIR, the generated codes are named by numbers, which is pretty hard to read. While we lower from the traditional pipeline, we can see the names pretty clearly. It is pretty helpful for debugging.
The text was updated successfully, but these errors were encountered: