This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add support for scalable vector masked load/store.
ClosedPublic

Authored by craig.topper on Mar 11 2021, 3:06 PM.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 11 2021, 3:06 PM
craig.topper requested review of this revision.Mar 11 2021, 3:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 11 2021, 3:06 PM
Herald added a subscriber: MaskRay. · View Herald Transcript

What happens for truncating stores, extending loads, etc? For example, does DAGCombine combine masked.load+sext by default or is it opt-in?

What happens for truncating stores, extending loads, etc? For example, does DAGCombine combine masked.load+sext by default or is it opt-in?

I couldn’t find a combine in DAGCombiner.cpp. As far as I could tell they can only be generated by the type legalizer. I think the fractional LMUL types mean we never Promote any i8/i16/i32 types so we won’t create an extending load or truncating store.

frasercrmck accepted this revision.EditedMar 12 2021, 8:38 AM

I couldn’t find a combine in DAGCombiner.cpp. As far as I could tell they can only be generated by the type legalizer. I think the fractional LMUL types mean we never Promote any i8/i16/i32 types so we won’t create an extending load or truncating store.

Fair enough, that's what I've seen with scatter/gather too.

Anyway, LGTM. Do all-true masks get auto-optimized to regular loads (edit: or stores, obviously), even for scalable vectors?

This revision is now accepted and ready to land.Mar 12 2021, 8:38 AM
This revision was landed with ongoing or failed builds.Mar 12 2021, 10:32 AM
This revision was automatically updated to reflect the committed changes.

I couldn’t find a combine in DAGCombiner.cpp. As far as I could tell they can only be generated by the type legalizer. I think the fractional LMUL types mean we never Promote any i8/i16/i32 types so we won’t create an extending load or truncating store.

Fair enough, that's what I've seen with scatter/gather too.

Anyway, LGTM. Do all-true masks get auto-optimized to regular loads (edit: or stores, obviously), even for scalable vectors?

Not yet. We need to migrate the code from using isBuildVectorAllZeros/Ones to the other function that considers splat_vector.