Skip to content

Commit 4357712

Browse files
committed
[RISCV] Inogre CallingConv::RISCV_VectorCall in getCalleeSavedRegs if V/Zve is not enabled.
We can't save vector registers without V/Zve.
1 parent 5b6f151 commit 4357712

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ RISCVRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
7272
}
7373

7474
bool HasVectorCSR =
75-
MF->getFunction().getCallingConv() == CallingConv::RISCV_VectorCall;
75+
MF->getFunction().getCallingConv() == CallingConv::RISCV_VectorCall &&
76+
Subtarget.hasVInstructions();
7677

7778
switch (Subtarget.getTargetABI()) {
7879
default:

0 commit comments

Comments
 (0)