This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Switch the costs of mve1beat and mve4beat
ClosedPublic

Authored by dmgreen on Jul 5 2022, 6:10 AM.

Details

Summary

These three subtarget features are meant to control where MVE instructions take 1 vs 2 vs 4 architectural beats. The mve1beat feature is described as "Model MVE instructions as a 1 beat per tick architecture", meaning MVE instruction will execute over 4 cycles. mve4beat is the opposite where the entire 4 beats of the MVE instruction execute in a single cycle. The costs for the two were backwards though, not matching the cycle counts like they should. This patch switches the costs on the two to bring them in-line with expectations.

Diff Detail

Event Timeline

dmgreen created this revision.Jul 5 2022, 6:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2022, 6:10 AM
dmgreen requested review of this revision.Jul 5 2022, 6:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 5 2022, 6:10 AM

Good job on catching this oversight. LGTM with a question about a test change.

llvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
2

Is this required, considering it doesn't change the rest of the test?

dmgreen added inline comments.Jul 7 2022, 7:00 AM
llvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
2

It is needed to keep the test checking the same thing. It requires that the MVE instructions have a cost of 1 for the same vectorization to happen.

samtebbs accepted this revision.Jul 7 2022, 7:05 AM

LGTM

llvm/test/Transforms/LoopVectorize/ARM/pointer_iv.ll
2

That makes sense, cheers.

This revision is now accepted and ready to land.Jul 7 2022, 7:05 AM
This revision was landed with ongoing or failed builds.Jul 7 2022, 8:10 AM
This revision was automatically updated to reflect the committed changes.