[llvm] da44a9b - [LoongArch] Add some comments to getBPReg. NFC

via llvm-commits llvm-commits at lists.llvm.org
Sun May 7 20:41:21 PDT 2023


Author: wanglei
Date: 2023-05-08T11:40:50+08:00
New Revision: da44a9b0fa413cef8fd4bea11e7c7d6fc8a6a28b

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

LOG: [LoongArch] Add some comments to getBPReg. NFC

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp
index c3d6692abe4dd..3b9ce9437d386 100644
--- a/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp
+++ b/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp
@@ -92,7 +92,9 @@ ABI getTargetABI(StringRef ABIName) {
   return TargetABI;
 }
 
-// FIXME: other register?
+// To avoid the BP value clobbered by a function call, we need to choose a
+// callee saved register to save the value. The `last` `S` register (s9) is
+// used for FP. So we choose the previous (s8) as BP.
 MCRegister getBPReg() { return LoongArch::R31; }
 
 } // end namespace LoongArchABI


        


More information about the llvm-commits mailing list