[PATCH] D139530: [WebAssembly] Add ComplexPattern for loads

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 05:56:21 PST 2022


asb added a comment.

In D139530#3979809 <https://reviews.llvm.org/D139530#3979809>, @aheejin wrote:

> Haven't read the code part yet, but I wonder, is there no way to cover the global-GEP folding tests with TableGen by adding some more patterns there? I think we are trying to keep patterns in TableGen if possible, especially if the patterns are not complex and used frequently, which I believe is the case for basic loads and stores.

I'd add a bit of context to this. I suggested that Luke take a look to see if the current patterns could be cleaned up using a `ComplexPattern`. For the RISC-V backend we similarly started out using a big list of patterns for loads/stores, but later made this same switch to a `ComplexPattern` and I think it was an improvement. It's right to prefer tablegen-based pattern matching where feasible, but I think in this case a relatively small amount of C++ code does make it easier to understand and maintain, with less room for errors by missing cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139530/new/

https://reviews.llvm.org/D139530



More information about the llvm-commits mailing list