[PATCH] D137495: [LoongArch] Add GHC Calling Convention

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 25 17:52:19 PST 2022


SixWeining added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp:194
   DebugLoc DL;
-
+  
+  // All calls are tail calls in GHC calling conv, and functions have no
----------------
Please remove useless spaces.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp:199
+    return;
+  
   // Determine the correct frame layout
----------------
Ditto.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp:330
   Register SPReg = LoongArch::R3;
-
+  
+  // All calls are tail calls in GHC calling conv, and functions have no
----------------
Ditto.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp:335
+    return;
+  
   MachineBasicBlock::iterator MBBI = MBB.getFirstTerminator();
----------------
Ditto.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:2539
                     nullptr, CC_LoongArch);
-
+  
+  if (CallConv == CallingConv::GHC && !RVLocs.empty())
----------------
Ditto.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:2542
+    report_fatal_error("GHC functions return void only");
+    
   SDValue Glue;
----------------
Ditto.


================
Comment at: llvm/test/CodeGen/LoongArch/ghc-cc.ll:107
+
+declare ghccc void @bar(i64, i64, i64, i64, i64, i64, i64, i64, i64, 
+                        float, float, float, float,
----------------
Ditto.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137495/new/

https://reviews.llvm.org/D137495



More information about the llvm-commits mailing list