[RFC] MatchTable-based GlobalISel Combiners

Hi, sorry for the late reply - I somehow didn’t get an email notification and missed this.

I’m not sure I understand, can you write a small example? No upstream combines were affected by this change, so I assume it’s a downstream issue?

In any case, I think the MatchTable is very flexible. It’s simply a framework for a state machine after all, so given a few refactors I’m sure we can make almost anything work. If I understand correctly, you would want a system to make a MIR pattern only match if all the instructions can be folded out? That’s definitely possible I believe.

I don’t mind waiting a bit if needed, I was planning to deprecate the backend this week & remove it sometime by the end of summer (probably late August/early September). I also plan do to a few refactors while I’m at it to make the Combiner pass work more like the ISel pass (= don’t make it re-instantiate the implementation on every instruction). Would that work for you?

If you encounter any major issues while porting this feel free to open an issue on GitHub and tag me, or simply send me an email directly. I’m happy to help!

Note that I’m also working on a MIR pattern system based on this RFC (re-using the same syntax as current MIR patterns, just with a lot more features). My goal is make it possible to rewrite most combines as pure tablegen/MIR patterns. That’s a separate topic though and we can discuss it when/if I publish an RFC for it (it’d be a very big patch so it needs to cook a bit longer)