This is an archive of the discontinued LLVM Phabricator instance.

[ARM][LV] Add a preferPredicatedReductionSelect target hook
ClosedPublic

Authored by dmgreen on Aug 14 2020, 10:54 AM.

Details

Summary

As part of D84741, this adds a target hook for the preferPredicatedReductionSelect option and makes use of it under MVE, allowing us to tail predicate most reduction loops.

Diff Detail

Event Timeline

dmgreen created this revision.Aug 14 2020, 10:54 AM

nit about the subject line:

[ARM][LV] Add a preferPredicatedReductionSelect target hook

[LV] - > [TTI]?

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1591–1597

Not sure if this also needs to be split off from the TTI part, so that we have 3 parts: LV, TTI, and the ARM change. But I am fine with this, and will leave this up to you whatever you think is most convenient (you can also just commit the TTI part, then this change).

1606

hey, that's new, I forgot but do we have a (negative) test for half types? :-)

llvm/test/Transforms/LoopVectorize/ARM/tail-folding-not-allowed.ll
269

I recently reorganised all the tail folding test (because it was getting a bit of a mess).
Looks like tail-folding-allowed.ll would now be a better home for this test (and the others below)?

dmgreen updated this revision to Diff 285996.EditedAug 17 2020, 6:17 AM

Thanks. This rejigs some tests (and adds one for f16).

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1606

Yeah, this is really to stop pointers, which can cause problem as live out values.

SjoerdMeijer accepted this revision.Aug 18 2020, 11:09 AM

Cheers, LGTM

This revision is now accepted and ready to land.Aug 18 2020, 11:09 AM