This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] Run non-trivial loop unswitching under -O2/3/s/z
ClosedPublic

Authored by aeubanks on Jan 11 2021, 1:52 PM.

Diff Detail

Event Timeline

aeubanks created this revision.Jan 11 2021, 1:52 PM
aeubanks requested review of this revision.Jan 11 2021, 1:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2021, 1:52 PM
aeubanks updated this revision to Diff 315929.Jan 11 2021, 1:53 PM

parameter comment

davide removed a reviewer: davide.Jan 11 2021, 1:59 PM
asbirlea accepted this revision.Jan 11 2021, 2:28 PM

lgtm.

This revision is now accepted and ready to land.Jan 11 2021, 2:28 PM
This revision was automatically updated to reflect the committed changes.

I took a closer look at what the legacy unswitch pass does in regards to -O2/3/s/z, and it skips non-trivial unswitching for anything other than -O3. So in the -O3 case I think the increased compile time and code size is expected. But the other cases should be fixed, I'll do that.
(weird that sqlite3 is an outlier and compiles 11% faster with this change though)

(also it would be nice to have -O1/2/s/z runs on llvm-compile-time-tracker, but of course you can only test so many configurations)

I'm curious if the compile time impact is complemented by impact in run time. Looking into that for O3.