[PATCH] D136215: [LoongArch] Add support for ISD::FRAMEADDR and ISD::RETURNADDR

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 19:19:19 PDT 2022


xen0n added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:241-246
+  // Currently only support lowering frame address for current frame.
+  unsigned Depth = cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue();
+  assert((Depth == 0) &&
+         "Frame address can only be determined for current frame.");
+  if (Depth != 0)
+    return SDValue();
----------------
Why this limitation? I can't seem to find similar guard in AArch64, CSKY, RISCV or VE, but it is indeed present for MIPS and SystemZ.


================
Comment at: llvm/test/CodeGen/LoongArch/frameaddr-returnaddr.ll:6
+declare i8* @llvm.frameaddress(i32)
+declare i8* @llvm.returnaddress(i32)
+
----------------
Please convert to opaque pointers throughout.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136215



More information about the llvm-commits mailing list