This is an archive of the discontinued LLVM Phabricator instance.

[ARM][MVE] Tail-Predication: recognise (again) active lanes IR pattern
ClosedPublic

Authored by SjoerdMeijer on Feb 11 2020, 3:33 AM.

Details

Summary

A small IR change in calculating the active lanes resulted in no longer recognising tail-predication. We used to calculate a vector containing the iteration counts for a vector body with e.g. 4 iterations with:

[i, i, i, i] + [0, 1, 2, 3]

but this is changed to:

[i, i, i, i] or [0, 1, 2, 3]

when this result is compared to the vector with loop iteration count vector [N, N, N, N] then this is equivalent, so now recognise both the 'add' and 'or'.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Feb 11 2020, 3:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 11 2020, 3:33 AM
dmgreen accepted this revision.Feb 11 2020, 4:06 AM

LGTM, if you can add a comment too.

llvm/lib/Target/ARM/MVETailPredication.cpp
273–274

I think if this was using an or it was because the BroadcastSplat value is mod Lanes. That is OK here because BroadcastSplat is IV which we know is a phi with 0 start and Lanes increment?

If so, can you add a comment that we know that it will be aligned, so an Or is equivalent to an Add?

This revision is now accepted and ready to land.Feb 11 2020, 4:06 AM
samparker added inline comments.Feb 11 2020, 5:17 AM
llvm/test/CodeGen/Thumb2/LowOverheadLoops/basic-tail-pred.ll
35

Does this mean we're no longer directly testing the 'add' form?

SjoerdMeijer marked an inline comment as done.Feb 11 2020, 6:49 AM

if you can add a comment too.

thanks, will do

llvm/test/CodeGen/Thumb2/LowOverheadLoops/basic-tail-pred.ll
88

Does this mean we're no longer directly testing the 'add' form?

We are testing both, there's one here for example, and I alternated the test here using 'and' and 'or'

This revision was automatically updated to reflect the committed changes.