mirror of https://github.com/llvm/torch-mlir
729402c3f4
The `assemblyFormat` stuff (which generates unrolled, per-op C++ code) was taking up a lot of compile time, and all the ops are essentially printed with the same logic. So this PR makes them all call the same helper function. This is done by using `let hasCustomAssemblyFormat = 1` and then implementing `FooOp::parse` and `FooOp::print`. Additionally, the `Generated*Ops.td` files are all collapsed into just `GeneratedTorchOps.td` (there is no reason to have the files separate, since the files are very large anyway so one is always having to search within them -- editors don't care that the file to search is now a bit bigger :) ). This reduces TorchOpsODSGenerated.cpp compile time (which is now GeneratedTorchOps.cpp) from 39 to 31 seconds on my machine. This is actually less than I expected, but this PR is an overall cleanup to the code anyway. The next step will be to introduce (better) functionality upstream for sharding the TorchOps.cpp.inc file, so that we can truly parallelize the O(#ops) costs. This is also necessary, because after this PR, TorchDialect.cpp is now the slowest file to compile, due to the `addOperations<... all the ops ...>` call, which needs to be shareded too. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
TorchDialect.cpp | ||
TorchOps.cpp | ||
TorchOpsODSGenerated.cpp | ||
TorchTypes.cpp | ||
UtilsForODSGenerated.cpp | ||
UtilsForODSGenerated.h |