[clang] [llvm] [Clang] Add `__builtin_stack_address` (PR #148281)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 09:00:42 PDT 2025


================
@@ -3680,6 +3681,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
     Results.push_back(Tmp1);
     break;
   }
+  case ISD::STACKADDRESS:
   case ISD::STACKSAVE:
     // Expand to CopyFromReg if the target set
     // StackPointerRegisterToSaveRestore.
----------------
moorabbit wrote:

> Should we simply issue a diagnostic for both ISD::STACKADDRESS and ISD:::STACKSAVE in this case instead

Following the approach used here:
https://github.com/llvm/llvm-project/blob/b2ff3e780a0995d4ffdc96db948ef3cd7e9c2695/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp#L1828-L1832

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


More information about the llvm-commits mailing list