-
Notifications
You must be signed in to change notification settings - Fork 14.3k
RISCV: Implement isLoadFromStackSlot/isStoreToStackSlot for rvv #120524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,15 @@ Register RISCVInstrInfo::isLoadFromStackSlot(const MachineInstr &MI, | |
case RISCV::FLD: | ||
MemBytes = 8; | ||
break; | ||
case RISCV::VL1RE8_V: | ||
case RISCV::VL2RE8_V: | ||
case RISCV::VL4RE8_V: | ||
case RISCV::VL8RE8_V: | ||
if (!MI.getOperand(1).isFI()) | ||
return Register(); | ||
FrameIndex = MI.getOperand(1).getIndex(); | ||
MemBytes = ~0u; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like StackSlotColoring is one of the only callers that use interface with MemBytes, but it doesn't look like it treats ~Ou as unknown. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only usage is to compare LoadSize and StoreSize, so it may not matter?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we can use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could also change the TTI signature to use TypeSize There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Split off in: #132244 |
||
return MI.getOperand(0).getReg(); | ||
} | ||
|
||
if (MI.getOperand(1).isFI() && MI.getOperand(2).isImm() && | ||
|
@@ -158,6 +167,15 @@ Register RISCVInstrInfo::isStoreToStackSlot(const MachineInstr &MI, | |
case RISCV::FSD: | ||
MemBytes = 8; | ||
break; | ||
case RISCV::VS1R_V: | ||
case RISCV::VS2R_V: | ||
case RISCV::VS4R_V: | ||
case RISCV::VS8R_V: | ||
if (!MI.getOperand(1).isFI()) | ||
return Register(); | ||
FrameIndex = MI.getOperand(1).getIndex(); | ||
MemBytes = ~0u; | ||
return MI.getOperand(0).getReg(); | ||
} | ||
|
||
if (MI.getOperand(1).isFI() && MI.getOperand(2).isImm() && | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about 1/2/4? And also Spill/Reload pseudos?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all the sizes showed up in tests with asserts. I didn't see any of the spill/reload pseudos appear either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you just added them! We still need handle
PseudoVSPILL
/PseudoVRELOAD
I think.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I never see the spill pseudos appear here for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may don't have ehough test coverages for segment types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this includes all of the instructions we actually use for reloading vector registers from the stack. There are other instructions we could use, but not that we do use. (Excluding the segment spill stuff as it's own sub-problem.)