[clang] [RFC][Docs][Clang][AMDGPU] Add AMDGPU builtins documentation (PR #181193)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 12 12:57:09 PST 2026
shiltian wrote:
The downside of generating it from TableGen is that it becomes all or nothing. Either people will completely ignore the optional documentation field, like what we already did for most of HIP dedicated attributes, or if we make it mandatory, they will have to write documentation for every single builtin.
Also, the current TableGen setup doesn't include argument names, since we are basically just defining the signature. It also does not seem feasible right now to attach documentation to each argument. That would require whoever writes the documentation to explicitly describe something like "argument 1 is A, which is for that purpose", which is another inconvenience. This could discourage people from writing documentation if it is not required.
AI, on the other hand, is very convenient for this. It can dig into the code, check constraints and requirements, and even pull information from comments in other places.
I'm not saying this can't be done with TableGen. But we would need to invest a lot of effort to extend TableGen to support that. If that's the direction we want to take, that's fine. In the meantime, this can serve as an interim solution.
I also don't think a TableGen-generated version would necessarily be much better than this one, especially since we would likely use AI to generate the documentation fields for existing builtins anyway, even after TableGen gains that capability. It would take a lot of effort to add the documentation fields manually.
https://github.com/llvm/llvm-project/pull/181193
More information about the cfe-commits
mailing list