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

Weining Lu via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 15 19:12:07 PDT 2022


Author: Weining Lu
Date: 2022-04-16T10:01:20+08:00
New Revision: dd018b96d4cce044feb9edd6b5da59b718231ace

URL: https://github.com/llvm/llvm-project/commit/dd018b96d4cce044feb9edd6b5da59b718231ace
DIFF: https://github.com/llvm/llvm-project/commit/dd018b96d4cce044feb9edd6b5da59b718231ace.diff

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

Added: 
    

Modified: 
    llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp
index aa576abff9757..c733c194e6a21 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);
 


        


More information about the llvm-commits mailing list