[llvm] Xtensa] Implement windowed call ABI. (PR #130001)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 15 19:12:23 PDT 2025


================
@@ -895,8 +895,14 @@ SDValue XtensaTargetLowering::LowerSTACKSAVE(SDValue Op,
 
 SDValue XtensaTargetLowering::LowerSTACKRESTORE(SDValue Op,
                                                 SelectionDAG &DAG) const {
-  return DAG.getCopyToReg(Op.getOperand(0), SDLoc(Op), Xtensa::SP,
-                          Op.getOperand(1));
+  if (Subtarget.isWindowedABI()) {
+    SDValue NewSP =
+        DAG.getNode(XtensaISD::MOVSP, SDLoc(Op), MVT::i32, Op.getOperand(1));
+    return DAG.getCopyToReg(Op.getOperand(0), SDLoc(Op), Xtensa::SP, NewSP);
+  } else {
----------------
arsenm wrote:

No else after return 

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


More information about the llvm-commits mailing list