[llvm] [Offload] Introduce offload-tblgen and initial new API implementation (PR #108413)
Jon Chesterfield via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 08:12:49 PDT 2024
JonChesterfield wrote:
Generating lots of redundant C++, where the redundancies are required by the language, is a good thing. Tablegen has pros and cons but is at least well established.
If we check in the generated code, we essentially guarantee that people will edit the generated files, and not the tablegen, and that review will miss this. The single source of truth will diverge from the thing actually running. However, if we do not check in the generated source, it'll be impossible to tell from the github review what has changed.
I would suggest we generate the source from tablegen, and check it in, and also have a unit testing step which generates the source again and diffs it against the copy in the local filesystem, and fails if they differ. As long as CI is running that test we'll catch the divergence.
Also don't call it new. This would be the... fourth? plugin revision and I think most of them are called some variant on "new".
Is it viable to develop the tablegen without the source checked in, and once it's holding together, have it replace the existing source files? Thus there is no new/old, just a transition from handwritten C++ into generated C++ which does the same thing, and we can permute the existing source code to look more like the generated output under CI.
https://github.com/llvm/llvm-project/pull/108413
More information about the llvm-commits
mailing list