[LoongArch] Fix typo that SP should be R3 but not R2

This commit is contained in:
Weining Lu 2022-04-09 16:52:24 +08:00
parent 64aff3632f
commit dd018b96d4
1 changed files with 2 additions and 1 deletions

View File

@ -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);