[llvm] [NVPTX] Add support for stacksave, stackrestore intrinsics (PR #114484)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 09:16:58 PDT 2024


================
@@ -2287,6 +2290,54 @@ SDValue NVPTXTargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
   return DAG.getNode(NVPTXISD::DYNAMIC_STACKALLOC, DL, RetTypes, AllocOps);
 }
 
+SDValue NVPTXTargetLowering::LowerSTACKRESTORE(SDValue Op,
+                                               SelectionDAG &DAG) const {
+  SDLoc DL(Op.getNode());
+  if (STI.getPTXVersion() < 73 || STI.getSmVersion() < 52) {
+    const Function &Fn = DAG.getMachineFunction().getFunction();
+
+    DiagnosticInfoUnsupported NoStackRestore(
+        Fn,
+        "Support for stackrestore introduced in PTX ISA version 7.3 and "
+        "requires target sm_52.",
----------------
AlexMaclean wrote:

Okay, I've updated the message, is the new version what you had in mind?

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


More information about the llvm-commits mailing list