This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Teach vsetvli insertion pass that operations on masks don't care about SEW/LMUL.
ClosedPublic

Authored by craig.topper on May 27 2021, 9:38 PM.

Details

Summary

All that really matters is that the VLMAX of the preceding
instructions is the same as the VLMAX required by the mask
operation.

Also update the vmsge(u) handling to use the SEW/LMUL we use for
other mask register operations. We were matching it to the compare
before. Some cases will be improve if we fix masked compares to
use tail agnostic policy. I think they ignore the tail policy
anyway.

Diff Detail

Event Timeline

craig.topper created this revision.May 27 2021, 9:38 PM
craig.topper requested review of this revision.May 27 2021, 9:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2021, 9:38 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
frasercrmck added inline comments.Jun 3 2021, 2:18 AM
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
185–196

I'm finding this comment a little confusing in that it says "unless this is a mask reg operation" but only (explicitly) checks Other.MaskRegOp. Is "this" implied, or should the comment be updated?

Rename variable and clean up comments to hopefully make things more clear.

frasercrmck accepted this revision.Jun 4 2021, 6:38 AM

LGTM, thanks

This revision is now accepted and ready to land.Jun 4 2021, 6:38 AM