This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][GlobalISel] Create a new minimal combiner pass just for -O0.
ClosedPublic

Authored by aemerson on May 6 2021, 5:52 PM.

Details

Summary

We never bothered to have a separate set of combines for -O0 in the prelegalizer before. This results in some minor performance hits for a mode where performance isn't a concern (although not regressing code size significantly is still preferable).

Through experiments, I've arrived at a set of combines that gets the most code size improvement at -O0, while reducing the amount of time spent in the combiner by around 25% give or take.

Diff Detail

Event Timeline

aemerson created this revision.May 6 2021, 5:52 PM
aemerson requested review of this revision.May 6 2021, 5:52 PM
aemerson updated this revision to Diff 343726.May 7 2021, 11:33 AM

Remove CSE from the combiner, this saves an additional 10% of the runtime in the pass, with no effect on code size.

paquette added inline comments.May 7 2021, 11:46 AM
llvm/include/llvm/Target/GlobalISel/Combine.td
661

At some point we should probably document the combiner groups.

664

missing newline

llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
41

This is still in the normal pre-legalizer combiner right?

Maybe we should factor the shared functions out into a separate file.

llvm/test/CodeGen/AArch64/combine-loads.ll
2

Maybe there should be a non-O0 checkline here too?

aemerson added inline comments.May 7 2021, 4:20 PM
llvm/test/CodeGen/AArch64/combine-loads.ll
2

This is a stupid test that shouldn't exist for -O0. I'm going to delete it.

aemerson updated this revision to Diff 343781.May 7 2021, 4:22 PM

Address comments. Factor out tryEmitBZero into the utils file.

Delete test that should never have been written.

aemerson updated this revision to Diff 343783.May 7 2021, 4:40 PM
paquette accepted this revision.May 7 2021, 4:59 PM

LGTM

This revision is now accepted and ready to land.May 7 2021, 4:59 PM
paquette added inline comments.May 7 2021, 5:00 PM
llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp
96 ↗(On Diff #343783)

missing newline

This revision was landed with ongoing or failed builds.May 7 2021, 5:07 PM
This revision was automatically updated to reflect the committed changes.