[PATCH] D155507: [RISCV] Hit the stack for MVT::f16 when there are no GPR-s left
Yueh-Ting (eop) Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 12:30:50 PDT 2023
eopXD created this revision.
eopXD added reviewers: craig.topper, kito-cheng.
Herald added subscribers: jobnoorman, luke, VincentWu, vkmr, frasercrmck, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson.
Herald added a project: All.
eopXD requested review of this revision.
Herald added subscribers: llvm-commits, wangpc, MaskRay.
Herald added a project: LLVM.
In D155502 <https://reviews.llvm.org/D155502>, we added code for the compiler to check GPR-s for f16
under zhinx. This commit adds code to hit the stack when we run out of
GPR-s.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D155507
Files:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -15197,6 +15197,12 @@
}
}
+ if (LocVT == MVT::f16) {
+ unsigned Offset2 = State.AllocateStack(2, Align(2));
+ State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset2, LocVT, LocInfo));
+ return false;
+ }
+
if (LocVT == MVT::i32 || LocVT == MVT::f32) {
unsigned Offset4 = State.AllocateStack(4, Align(4));
State.addLoc(CCValAssign::getMem(ValNo, ValVT, Offset4, LocVT, LocInfo));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155507.541187.patch
Type: text/x-patch
Size: 631 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230717/303c47de/attachment.bin>
More information about the llvm-commits
mailing list