This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Ensure loop invariant active.lane.mask operands
ClosedPublic

Authored by dmgreen on Apr 15 2021, 4:35 AM.

Details

Summary

CGP can move instructions like a ptrtoint into a loop, but the MVETailPredication when converting them will currently assume invariant trip counts. This tries to ensure the operands are loop invariant, and bails if not.

Diff Detail

Event Timeline

dmgreen created this revision.Apr 15 2021, 4:35 AM
dmgreen requested review of this revision.Apr 15 2021, 4:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2021, 4:35 AM
SjoerdMeijer accepted this revision.Apr 23 2021, 1:00 AM

Yep, looks like a good fix to me.

llvm/test/CodeGen/Thumb2/mve-tailpred-loopinvariant.ll
85

Not that I mind too much, but can we not reduce this test case a bit?

This revision is now accepted and ready to land.Apr 23 2021, 1:00 AM
dmgreen added inline comments.Apr 25 2021, 1:03 PM
llvm/test/CodeGen/Thumb2/mve-tailpred-loopinvariant.ll
85

This test I actually want to turn into something better, I have managed to write up some test and put that into D101263.

Otherwise we have to do something about the vectorizer costs, because this is obviously not beneficial. I'm hoping that by optimizing it we can keep the vectorization.

This revision was automatically updated to reflect the committed changes.