This is an archive of the discontinued LLVM Phabricator instance.

[Polly] Add -polly-prune-unprofitable pass.
ClosedPublic

Authored by Meinersbur on Mar 16 2017, 7:52 AM.

Details

Summary

ScopInfo's normal profitability heuristic considers SCoPs where all statements have scalar writes as not profitably optimizable and invalidate the SCoP in that case. However, -polly-delicm and -polly-simplify may be able to remove some of the scalar writes such that the flag -polly-unprofitable-scalar-accs=false allows disabling that part of the heuristic.

In cases where DeLICM (or other passes after ScopInfo) are not successful in removing scalar writes, the SCoP is still not profitably optimizable. The schedule optimizer would again try computing another schedule, resulting in slower compilation.

The -polly-prune-unprofitable pass applies the profitability heuristic again before the schedule optimizer Polly can still bail out even with -polly-unprofitable-scalar-accs=false.

Diff Detail

Repository
rL LLVM

Event Timeline

Meinersbur created this revision.Mar 16 2017, 7:52 AM
grosser accepted this revision.Mar 16 2017, 9:21 AM

LGTM. Any reason this is not enbled by default? Seems simple enough to enable and then we get immediately wider testing.

This revision is now accepted and ready to land.Mar 16 2017, 9:21 AM

The reason it is not default is that it is useless without having DeLICM/Simplify enabled as well.

We can think about turning them all on by default when the chain starts being useful. At least known-value for DeLICM should be in it. Before then, we can test individual parts by using -polly-enable-*.

Maybe not useful, but there is also no cost involved, right? This would make sure we get LNT test coverage on the before-position=before-vectorizer bot.

This revision was automatically updated to reflect the committed changes.