This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Refactor classes for load/store instructions of V extension
ClosedPublic

Authored by bin.cheng on Sep 6 2021, 5:19 AM.

Details

Summary

Hi,
This patch refactors classes for load/store of V extension by:

  • Introduce new class for VUnitStrideLoadFF and VUnitStrideSegmentLoadFF so that uses of L/SUMOP* are not spread around different places.
  • Reorder classes for Unit-Stride load/store in line with table describing lumop/sumop in riscv-v-spec.pdf.

As I reading the code I found this simple refactoring might make it easier to understand.
I am new to RISC-V backend, not sure if this is in the correct direction. So please correct if I am wrong.

Thanks,
bin

Diff Detail

Event Timeline

bin.cheng created this revision.Sep 6 2021, 5:19 AM
bin.cheng requested review of this revision.Sep 6 2021, 5:19 AM

Gentle ping. Could any one review this? So that I can drop it if it's not wanted.

Thanks

craig.topper added inline comments.Sep 26 2021, 10:49 AM
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
140

fault-on-first -> fault-only-first

HsiangKai added inline comments.Sep 27 2021, 12:23 AM
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
160

update the comment to "unit-stride segment load" to sync with above comments.

172

strided segment load

179

indexed segment load

189

unit-stride store

204

unit-stride masked store

211

stride store

217

indexed store

bin.cheng added inline comments.Sep 28 2021, 8:56 AM
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
211

stride store

Thank both of you for reviewing. I will update all comments. Additionally "strided store" for this one to be consistent with spec.

bin.cheng updated this revision to Diff 375598.Sep 28 2021, 9:07 AM

Update comments in patch. Thanks

bin.cheng marked 8 inline comments as done.Sep 28 2021, 9:11 AM
bin.cheng added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoV.td
204

unit-stride masked store

I am using "unit-stride mask store" to be consistent with spec.

This revision is now accepted and ready to land.Sep 30 2021, 5:18 AM
This revision was landed with ongoing or failed builds.Nov 5 2021, 7:48 PM
This revision was automatically updated to reflect the committed changes.
bin.cheng marked an inline comment as done.