https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127630
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Originally RTL was out of scope for match.pd not only but specifically because that uses tree codes and tree predicates and types all over the place. What I'd like to avoid is having duplicate patterns. To include RTL we'll have to abstract GENERIC/GIMPLE/RTL concepts, so in the most clean way we'd have new match IL that can expand to all of them. My pragmatic idea was to somehow auto-identify eligible match.pd patterns (or manually tag them!) to allow for a simple N:M mapping of tree codes to RTL codes and literally re-using some patterns, necessarily ones without any (if ...) or predicates relying on trees or only with new abstracted checks. A lot of the bit-operation patterns would qualify I think. One example: (simplify (bit_ior:c (bit_xor:c @0 @1) @0) (bit_ior @0 @1)) not sure if that's "good enough" to be useful. For clarity it might mean to split such patterns into a common.md file (and we should now really have a gimple.md file with so many #if GIMPLE only patterns).
