From dd018b96d4cce044feb9edd6b5da59b718231ace Mon Sep 17 00:00:00 2001 From: Weining Lu Date: Sat, 9 Apr 2022 16:52:24 +0800 Subject: [PATCH] [LoongArch] Fix typo that SP should be R3 but not R2 --- .../Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp index aa576abff975..c733c194e6a2 100644 --- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp +++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp @@ -59,7 +59,8 @@ static MCAsmInfo *createLoongArchMCAsmInfo(const MCRegisterInfo &MRI, const MCTargetOptions &Options) { MCAsmInfo *MAI = new LoongArchMCAsmInfo(TT); - MCRegister SP = MRI.getDwarfRegNum(LoongArch::R2, true); + // Initial state of the frame pointer is sp(r3). + MCRegister SP = MRI.getDwarfRegNum(LoongArch::R3, true); MCCFIInstruction Inst = MCCFIInstruction::cfiDefCfa(nullptr, SP, 0); MAI->addInitialFrameState(Inst);