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

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 22:24:17 PST 2022


xen0n added a comment.

Thanks for the contribution, I've checked against your GHC-side changes <https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9292> and the register convention looks good. Apart from some minor nits this should be good to go.



================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:445-446
+    report_fatal_error("Unsupported code model for lowering");
+  // TODO: Add Small CodeModel.
+  case CodeModel::Small: {
+    return SDValue(DAG.getMachineNode(LoongArch::PseudoLA_PCREL, DL, Ty, Addr),
----------------
Is the comment still necessary? The small codemodel case is being implemented right below...


================
Comment at: llvm/test/CodeGen/LoongArch/ghc-cc.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc --mtriple=loongarch64 -mattr=+f,+d < %s | FileCheck %s --check-prefix=LA64
+
----------------
In LoongArch testcases `--mattr` (double-dash) is used throughout.


================
Comment at: llvm/test/CodeGen/LoongArch/ghc-cc.ll:84-100
+  %0  = load double, double* @d4
+  %1  = load double, double* @d3
+  %2  = load double, double* @d2
+  %3  = load double, double* @d1
+  %4  = load float, float* @f4
+  %5  = load float, float* @f3
+  %6 = load float, float* @f2
----------------
Please convert to opaque pointers.


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

https://reviews.llvm.org/D137495



More information about the llvm-commits mailing list