[llvm] [Xtensa] Lowering FRAMEADDR/RETURNADDR operations. (PR #107363)

Andrei Safronov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 15:00:43 PDT 2024


================
@@ -722,6 +742,24 @@ SDValue XtensaTargetLowering::LowerSTACKRESTORE(SDValue Op,
                           Op.getOperand(1));
 }
 
+SDValue XtensaTargetLowering::LowerFRAMEADDR(SDValue Op,
+                                             SelectionDAG &DAG) const {
+  // check the depth
+  assert((cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue() == 0) &&
+         "Frame address can only be determined for current frame.");
+
+  MachineFunction &MF = DAG.getMachineFunction();
+  MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
+  MFI.setFrameAddressIsTaken(true);
+  EVT VT = Op.getValueType();
+  SDLoc DL(Op);
+
+  unsigned FrameRegister = Subtarget.getRegisterInfo()->getFrameRegister(MF);
----------------
andreisfr wrote:

Corrected

https://github.com/llvm/llvm-project/pull/107363


More information about the llvm-commits mailing list