This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Combine (store/load interleave,deinterleave) into vsseg2/vlseg2
AbandonedPublic

Authored by luke on Feb 16 2023, 2:19 AM.

Details

Summary

Currently scalable and fixed stores are combined, but only loads of
scalable vectors are combined for now.

Diff Detail

Event Timeline

luke created this revision.Feb 16 2023, 2:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2023, 2:19 AM
luke requested review of this revision.Feb 16 2023, 2:19 AM
craig.topper added inline comments.Feb 16 2023, 10:14 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
10913

How have we guaranteed the load has an MVT type?

10916

This isn't enough to guarantee the type is legal. DAG combine has to be very careful with types.

10922

I think we need to check isNormalLoad for the load to make sure it isn't an extending or indexed load. Probably a good idea to check isSimple too. Especially since you aren't checking that this is the only use of the load. Same applies for stores

luke updated this revision to Diff 498323.Feb 17 2023, 4:09 AM

Address review comments

luke updated this revision to Diff 498326.Feb 17 2023, 4:11 AM

Remove erroneous include

craig.topper added inline comments.Feb 18 2023, 3:26 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
10874

I don't think check simple is enough. You need to check isTypeLegal.

luke updated this revision to Diff 499104.Feb 21 2023, 3:48 AM

Check if type is legal

luke marked 3 inline comments as done.Feb 21 2023, 3:49 AM
luke updated this revision to Diff 510452.Apr 3 2023, 4:34 AM

Don't look up pseudos, use helper function to check if EMUL and EEW are valid

luke abandoned this revision.Jun 27 2023, 4:41 AM

Trying to do this as a combine is tricky, as we need to somehow combine it before the vector_interleave/vector_deinterleave ops are legalised, but after the types are legalised. I'm going to rework this to use the lowerInterleaveIntrinsicToStore/lowerDeinterleaveIntrinsicToLoad target lowering hooks introduced in D146218 instead.

evandro removed a subscriber: evandro.Jun 27 2023, 9:40 AM