This pattern, when imported at -O0 adds an extra copy via the SUBREG_TO_REG.
This is because the copy from the SUBREG_TO_REG is not eliminated. At all other opt levels, it is eliminated.
This is a 1% geomean code size savings at -O0 on CTMark.
Also I tried my hardest to make that predicate fit into 80 columns, but it wasn't meant to be. If you do that, it will not be properly imported into AArch64GenDAGISel.inc.
E.g. if you do this:
def OptimizedGISelOrOtherSelector : Predicate<[{ !MF->getFunction().hasOptNone() || MF->getProperties().hasProperty(MachineFunctionProperties::Property::FailedISel) || !MF->getProperties().hasProperty(MachineFunctionProperties::Property::Legalized) }]>;
You get amazing things like this in AArch64GenDAGISel.inc:
/* 63221*/ OPC_CheckPatternPredicate, 21, // ( !MF->getFunction().hasOptNone() || MF->getProperties().hasProperty(MachineFunctionProperties::Property::FailedISel) || !MF->getProperties().hasProperty(MachineFunctionProperties::Property::Legalized) )