[mlir][Interfaces] Generate a struct containing function pointers instead of a class...
authorRiver Riddle <riddleriver@gmail.com>
Tue, 27 Oct 2020 23:03:07 +0000 (16:03 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 27 Oct 2020 23:16:51 +0000 (16:16 -0700)
commitef728eaf6e8de17b9f5bac89c972a94e37e4f09e
tree35f7c42a8b8c26bb85223f48ffa14075b466efae
parentd989ae90693ec2d1b7e048a7b48cbab3cfa8123b
[mlir][Interfaces] Generate a struct containing function pointers instead of a class with vtables

When compiling for code size, the use of a vtable causes a destructor(and constructor in certain cases) to be generated for the class. Interface models don't need a complex constructor or a destructor, so this can lead to many megabytes of code size increase(even in opt). This revision switches to a simpler struct of function pointers approach that accomplishes the same API requirements as before. This change requires no updates to user code, or any other code aside from the generator, as the user facing API is still exactly the same.

Differential Revision: https://reviews.llvm.org/D90085
mlir/tools/mlir-tblgen/OpInterfacesGen.cpp