This is an archive of the discontinued LLVM Phabricator instance.

[X86][NFC] Refine load/store reg to StackSlot for extensibility
ClosedPublic

Authored by xiangzhangllvm on Aug 31 2022, 6:24 PM.

Details

Summary

Refine X86InstrInfo::storeRegToStackSlot and X86InstrInfo::loadRegFromStackSlot for extensibility

Diff Detail

Event Timeline

xiangzhangllvm created this revision.Aug 31 2022, 6:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 6:24 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
xiangzhangllvm requested review of this revision.Aug 31 2022, 6:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2022, 6:24 PM
pengfei added inline comments.Aug 31 2022, 6:36 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3859–3866

Where's this code?

3899–3906

ditto.

pengfei added inline comments.Aug 31 2022, 6:43 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3616

I think we don't need an extra function. Just like line 3591-3598.

3859–3866

I understood the change now.

xiangzhangllvm added inline comments.Aug 31 2022, 7:20 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3616

That is just for future extension.

pengfei accepted this revision.Sep 4 2022, 8:31 PM

LGTM.

This revision is now accepted and ready to land.Sep 4 2022, 8:31 PM
craig.topper added inline comments.
llvm/lib/Target/X86/X86InstrInfo.cpp
3553

Capitalize load I know it was wrong before, but should we keep propagating it?

3854

function names should be lower case and start with a verb. "SpecialOpcode" is also vague. Can it be more specific?

xiangzhangllvm added inline comments.Sep 4 2022, 11:27 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3553

OK, let all "load" to Load. thank you!

3854

let me rename it to isTILEReg, in fact, at first I consider it may has other specific reg (not only tile) in the futher, so I name it "Special".

xiangzhangllvm added inline comments.Sep 4 2022, 11:55 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3854

let me rename it to isTILEReg, in fact, at first I consider it may has other specific reg (not only tile) in the futher, so I name it "Special".

3854

let me rename it to isTILEReg, in fact, at first I consider it may has other specific reg (not only tile) in the futher, so I name it "Special".

typo, sorry , isTILEReg --> isAMXOpcode

Address Craig's comments

xiangzhangllvm marked 2 inline comments as done.Sep 5 2022, 1:59 AM

Do clang-format.

LuoYuanke added inline comments.Sep 5 2022, 7:09 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3553

What does the suffix s mean? Rename it to getFR16LoadStoreOpcode?

3864

Rename it to loadStoreTileReg? It is unnecessary to introduce spill concept here.

xiangzhangllvm added inline comments.Sep 5 2022, 7:29 PM
llvm/lib/Target/X86/X86InstrInfo.cpp
3553

Seems not need, Let me remove it.

3864

OK, That is good.

Address Yuanke's comments

xiangzhangllvm marked 2 inline comments as done.Sep 5 2022, 7:54 PM
This revision was landed with ongoing or failed builds.Sep 6 2022, 11:36 PM
This revision was automatically updated to reflect the committed changes.