This is an archive of the discontinued LLVM Phabricator instance.

[LoopVectorizer][ARM] Add preferInloopReduction target hook.
ClosedPublic

Authored by dmgreen on Mar 3 2020, 3:59 AM.

Details

Summary

This allows the backend to tell the vectorizer to produce inloop reductions through a TTI hook.

For the moment on ARM under MVE this means allowing integer add reductions of the correct size. In the future this can include integer min/max too, under -Os. Taken out of D75069.

Diff Detail

Event Timeline

dmgreen created this revision.Mar 3 2020, 3:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
dmgreen updated this revision to Diff 278700.Jul 17 2020, 3:24 AM
dmgreen edited the summary of this revision. (Show Details)
dmgreen added reviewers: SjoerdMeijer, fhahn, Ayal.
dmgreen retitled this revision from [LoopVectorizer][ARM] Add preferInloopReduction reduction. to [LoopVectorizer][ARM] Add preferInloopReduction target hook..Sep 6 2020, 11:54 PM

Ping

SjoerdMeijer accepted this revision.Sep 7 2020, 12:27 AM

Looks good to me.

Is there a test case for ScalarBits > 32?

This revision is now accepted and ready to land.Sep 7 2020, 12:27 AM

Thanks

There are some tests for 64bit reductions. We will probably want to enable inloop reductions for them in the future too, as we have the instructions. That will require a lot of costmodel improvements though.

There are some tests for 64bit reductions. We will probably want to enable inloop reductions for them in the future too, as we have the instructions. That will require a lot of costmodel improvements though.

Ah, okay, I thought it was related to not having (much) i64 instructions. Perhaps worth adding your remark as a comment to that check.

This revision was automatically updated to reflect the committed changes.