This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][WIP] Update isLegalAddressingMode for RVV.
ClosedPublic

Authored by craig.topper on May 2 2022, 8:52 PM.

Details

Summary

RVV instructions only support base register addressing.

Probably need more directed LSR tests and maybe CodeGenPrepare.

Diff Detail

Event Timeline

craig.topper created this revision.May 2 2022, 8:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2022, 8:52 PM
craig.topper requested review of this revision.May 2 2022, 8:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2022, 8:52 PM
reames accepted this revision.May 3 2022, 12:56 PM

LGTM w/comment addressed.

I applied this locally and checked a couple of hand written vector loops I'm using to get myself started, and the results look entirely reasonable.

llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1025

Placement wise, this makes more sense at the top so that all of the scalar checks are grouped together.

This revision is now accepted and ready to land.May 3 2022, 12:56 PM
craig.topper added inline comments.May 3 2022, 1:46 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1025

Top, or just above the 12-bit offset check?

reames added inline comments.May 3 2022, 1:57 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1025

Ah, you're right.

Or alternately, top, and duplicate the BaseGV check.

Either is fine.

This revision was landed with ongoing or failed builds.May 3 2022, 7:50 PM
This revision was automatically updated to reflect the committed changes.