This is an archive of the discontinued LLVM Phabricator instance.

[LoopInterchange] Loops with empty dependency matrix are safe.
ClosedPublic

Authored by fhahn on Feb 13 2018, 7:21 AM.

Details

Summary

The dependency matrix is only empty if no conflicting load/store
instructions have been found. In that case, it is safe to interchange.

For the LLVM test-suite, after this change around 1900 loops are
interchanged, whereas it is 15 before this change. On cortex-a57,
this gives an improvement of -0.57% on the geomean execution
time of SPEC2006, SPEC2000 and the test-suite. There are a
few small perf regressions, but I think we can improve on those
by making the cost model better.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Feb 13 2018, 7:21 AM
fhahn updated this revision to Diff 135799.Feb 24 2018, 9:44 AM
fhahn edited the summary of this revision. (Show Details)

Ping, rebased diff

This revision was not accepted when it landed; it landed in state Needs Review.Feb 26 2018, 2:47 AM
This revision was automatically updated to reflect the committed changes.
davide added a subscriber: davide.Feb 26 2018, 7:58 AM

Can we add a test for this?

Just noticed you added it later, never mind.

fhahn added a comment.Feb 26 2018, 8:06 AM

Just noticed you added it later, never mind.

Yeah I somehow managed to mess up the diff in Phabricator... But rL326078 added the test case.

Hello, any reason why LoopInterchange pass is not on by default?

fhahn added a comment.Jul 22 2018, 9:37 AM

Hello, any reason why LoopInterchange pass is not on by default?

There used to be some bugs causing crashes, but all known/reported bugs are fixed now. Currently the set of supported loops is quite limited and there are at least 2 things I would like to address before enabling it. I've created https://bugs.llvm.org/show_bug.cgi?id=38263 as a place to keep track of enabling it, with some more details.
Getting patches for LoopInterchange takes a while, because there are not many people working on it, but my strategy has been to just move them along at a slow pace :)