This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Don't import i64imm_32bit pattern at -O0
ClosedPublic

Authored by paquette on Aug 30 2019, 4:16 PM.

Details

Summary

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)
  )

Diff Detail

Repository
rL LLVM

Event Timeline

paquette created this revision.Aug 30 2019, 4:16 PM
aemerson accepted this revision.Aug 31 2019, 3:04 PM

LGTM.

This revision is now accepted and ready to land.Aug 31 2019, 3:04 PM
This revision was automatically updated to reflect the committed changes.