Page MenuHomePhabricator

[ARM] Add patterns for select(p, BinOp(x, y), z) -> BinOpT(x, y,p z)

Authored by dmgreen on Jul 6 2020, 6:14 AM.



Most MVE instructions can be predicated to fold a select into the instruction, using the predicate and the select "else" as a passthough. This adds tablegen patterns for most two operand instructions using the newly added TwoOpPattern from D83219. It could probably be done differently, perhaps after ISel as a peephole optimisation, but doing it in tblgen gives a good excuse to clear up some of the existing patterns.

Diff Detail

Event Timeline

dmgreen created this revision.Jul 6 2020, 6:14 AM
SjoerdMeijer accepted this revision.Thu, Jul 16, 1:23 AM

Nothing wrong with a good tablegen pattern, think I prefer that much more than a peephole!

This revision is now accepted and ready to land.Thu, Jul 16, 1:23 AM

Thanks. Yeah, there will likely be another couple of patterns needed here too. They show this works quite well over a peephole I think.

This revision was automatically updated to reflect the committed changes.