Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nvgpu] Expose helper code from NVGPU to LLVM lowering (NFC). (#4235)
OpenXLA would like to reuse code from `NVGPUOpPatternBase` for Sparsity lowering. Currently this is done by patching `NVGPUToLLVMPass.cpp` to add an extra pattern deriving from `NVGPUOpPatternBase`. Instead, we would like to move this pattern to the downstream OpenXLA repository. This change removes the `NVGPUOpPatternBase` base class and exposes the core lowering code as a utility function (`rewriteAsPtxAsm()`) instead. The existing patterns now directly inherit from `mlir::OpRewritePattern` and use this utility function. I hope that exposing an extra function is acceptable. I tried to balance it with cleaning up the code a bit (e.g., no more CRTP, but of course that's subjective).
- Loading branch information