Page MenuHomePhabricator

[LoongArch] Support register-register-addressed GPR loads/stores
ClosedPublic

Authored by xen0n on Aug 8 2022, 12:09 AM.

Diff Detail

Event Timeline

xen0n created this revision.Aug 8 2022, 12:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 12:09 AM
xen0n requested review of this revision.Aug 8 2022, 12:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 12:09 AM
xen0n retitled this revision from [LoongArch] Support native GPR loads/stores using register-register addressing to [LoongArch] Support register-register-addressed GPR loads/stores.Aug 8 2022, 12:16 AM
SixWeining added inline comments.Aug 8 2022, 2:31 AM
llvm/test/CodeGen/LoongArch/ir-instruction/load-store.ll
464

For load, you use i64 no matter what the type of %val is . Here you use the same type as %val. Is this intented?

xen0n added inline comments.Aug 8 2022, 2:33 AM
llvm/test/CodeGen/LoongArch/ir-instruction/load-store.ll
464

Oh well. I wrote the i64 version first, then copied and substituted types for the rest (including this one), apparently *this* i64 got replaced as well. Thanks for spotting this inconsistency, I'll fix.

xen0n updated this revision to Diff 450740.Aug 8 2022, 2:37 AM

Use i64 for all index parameters for consistency.

xen0n marked an inline comment as done.Aug 8 2022, 2:38 AM
wangleiat added inline comments.Aug 8 2022, 2:42 AM
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
861

Only for LA64 i64 is ok, GRLenVT will increase isel table size.

861

AddLike-> add

897

ditto

897

ditto

xen0n updated this revision to Diff 450746.Aug 8 2022, 3:06 AM

Simplify patterns a bit according to @wangleiat's suggestion.

xen0n marked 4 inline comments as done.Aug 8 2022, 3:08 AM
xen0n updated this revision to Diff 450748.Aug 8 2022, 3:10 AM

reorder the patterns a bit for prettier formatting

SixWeining added inline comments.Aug 8 2022, 4:24 AM
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
863

Will f32 and f64 be coverred in another patch? If so, had better rename the patch title to limit the change to integer load/store.

xen0n marked an inline comment as done.Aug 8 2022, 5:15 AM
xen0n added inline comments.
llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
863

Will f32 and f64 be coverred in another patch? If so, had better rename the patch title to limit the change to integer load/store.

Yeah I plan to do so; I already mentioned "GPR" in the title. ;-)

SixWeining accepted this revision.Aug 8 2022, 5:29 AM

LGTM. Thanks.

llvm/lib/Target/LoongArch/LoongArchInstrInfo.td
863

Sorry I didn't noticed that. It's OK for me. Thanks.

This revision is now accepted and ready to land.Aug 8 2022, 5:29 AM
This revision was landed with ongoing or failed builds.Aug 9 2022, 4:18 AM
This revision was automatically updated to reflect the committed changes.