Skip to content

Commit b0709d0

Browse files
toppercKaiYG
authored andcommitted
[RISCV] Fix double counting scalar CSRs with Zcmp when emitting cfi_offset for RVV CSRs. (llvm#117408)
getCalleeSavedStackSize() already contains RVPushStackSize. Don't subtract it again.
1 parent e656b3b commit b0709d0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,8 +1658,7 @@ void RISCVFrameLowering::emitCalleeSavedRVVPrologCFI(
16581658
if (!HasFP) {
16591659
uint64_t ScalarLocalVarSize =
16601660
MFI.getStackSize() - RVFI->getCalleeSavedStackSize() -
1661-
RVFI->getRVPushStackSize() - RVFI->getVarArgsSaveSize() +
1662-
RVFI->getRVVPadding();
1661+
RVFI->getVarArgsSaveSize() + RVFI->getRVVPadding();
16631662
FixedSize -= ScalarLocalVarSize;
16641663
}
16651664

0 commit comments

Comments
 (0)