This is an archive of the discontinued LLVM Phabricator instance.

[NFC][GVN] Put phi-translation of 'add' behind a switch
ClosedPublic

Authored by peterwaller-arm on Jul 21 2022, 3:07 AM.

Details

Summary

The code in this #if 0 block appears to be a net benefit. Put it
behind a switch defaulting to off to support experimentation and as a
request for comment.

The codegen impact of enabling this that I'm currently persuing is that
it allows PRE to take place more frequently, particularly in loops with
second order recurrences.

Preliminary experimental data:

Across LNT on AArch64, 54 benchmarks are sped up by >1%, and 42 are
regressed by >1%, the geomean (exec_time_enabled / exec_time_disabled)
of these 96 "1% or greater significance" benchmarks is 0.991. For the
full set of 770 benchmarks it's 0.998.

There are two benchmarks which experience a >30% speedup, and the worst
slowdown is ~12%, and for every benchmark with a slowdown there is a
benckmark which is sped up by a greater factor.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 3:07 AM
peterwaller-arm requested review of this revision.Jul 21 2022, 3:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 3:07 AM
paulwalker-arm added a comment.EditedJul 21 2022, 5:21 AM

Sounds sensible to me to have this as a user choice rather than a compile time one. Can you add a test to show the change in behaviour we want to see when enabling this option?

  • Add test showing the effect of the switch.
paulwalker-arm accepted this revision.Jul 22 2022, 7:01 AM
This revision is now accepted and ready to land.Jul 22 2022, 7:01 AM
This revision was landed with ongoing or failed builds.Jul 25 2022, 1:01 AM
This revision was automatically updated to reflect the committed changes.