This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Spilling for RISC-V V extension.
AbandonedPublic

Authored by HsiangKai on Dec 24 2020, 5:16 AM.

Diff Detail

Event Timeline

HsiangKai created this revision.Dec 24 2020, 5:16 AM
HsiangKai requested review of this revision.Dec 24 2020, 5:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 24 2020, 5:16 AM
Herald added a subscriber: MaskRay. · View Herald Transcript
HsiangKai updated this revision to Diff 313693.Dec 24 2020, 6:47 AM
frasercrmck added inline comments.Dec 29 2020, 11:44 AM
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
97

Should hasFP not pessimistically return true if V is enabled?

HsiangKai added inline comments.Jan 3 2021, 5:53 PM
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
97

Do you mean to move Subtarget.hasStdExtV() into hasFP()? To consider spilling, it seems reasonable.

frasercrmck added inline comments.Jan 4 2021, 1:35 AM
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
97

Yeah, that's what I meant. I believe I had a thought a few hours after that comment why you might not want hasStdExtV in hasFP, but I've forgotten it now.

craig.topper added inline comments.Jan 4 2021, 4:37 PM
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
851–853

Use if/else here. The conditional operator with no assignment looks kind of strange.

858–860

Same here

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
97

I don't see an equivalent of this in AArch64 when SVE is enabled. How are the avoiding needing a frame pointer?

HsiangKai added inline comments.Jan 10 2021, 11:34 PM
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
97

Indeed, it is possible to access frame objects without reserving frame pointer when there is any RVV objects on the stack. If we do not leverage frame pointer when there is any RVV objects, all frame object accesses will need do some polynomial calculation.

Now, there is a new type to represent two dimensions stack offset. I could try to implement it without reserving the frame pointer.

lenary added inline comments.Jan 14 2021, 9:42 AM
llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp
97

Being deep within hasFP code right now, and seeing that it has some nasty edge-cases when introducing ilp32e, it seems prudent to start with a conservatively correct approach for the initial implementation, and then optimise to avoid using frame pointers if necessary?

That should also make reviewer's lives easier :)

HsiangKai abandoned this revision.Jan 21 2021, 9:29 AM

Review D95148 instead of this one.