This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Use maskedoff to decide mask policy for masked compare and vmsbf/vmsif/vmsof.
ClosedPublic

Authored by khchen on Mar 24 2022, 9:00 PM.

Details

Summary

masked compare and vmsbf/vmsif/vmsof are always tail agnostic, we could
check maskedoff value to decide mask policy rather than have a addtional
policy operand.

Diff Detail

Event Timeline

khchen created this revision.Mar 24 2022, 9:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 9:00 PM
khchen requested review of this revision.Mar 24 2022, 9:00 PM
arcbbb added inline comments.Mar 27 2022, 9:13 AM
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
546

This change implies that ForceTailAgnostic overrides all other rules.
Maybe we still want to keep the previous logic:
If there is a policy, we follow it.
Otherwise we look at the tied operand if ForceTailAgnostic is unset.

craig.topper added inline comments.Mar 27 2022, 1:33 PM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
1111

policyt -> policy

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
546

ForceTailAgnostic is an instruction property. It shouldn't be set on any instructions that have a policy operand.

khchen updated this revision to Diff 418475.Mar 27 2022, 6:36 PM

Fix typo. Thanks!
It's good to update this chagned soon if it does make sense,
because I change the IR interface again...
I believe changing the IR interface frequently is annoying.

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
546

I think this change still keep the original logic because I force tail policy as agnostic if ForceTailAgnostic is true , but has more ability to decide the mask policy according to merge operand is undef or not.
You could see the ForceTailAgnostic is only used in this else if statement to keep the TailAgnostic would not be changed.

craig.topper accepted this revision.Mar 29 2022, 3:09 PM

LGTM with the typo fixed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
1120

assgin -> assign

This revision is now accepted and ready to land.Mar 29 2022, 3:09 PM
This revision was landed with ongoing or failed builds.Mar 29 2022, 6:21 PM
This revision was automatically updated to reflect the committed changes.