[llvm] [SelectionDAG][NFC] Move EmitStackConvert from LegalizeDAG to SelectionDAG (PR #221357)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 00:53:37 PDT 2026


================
@@ -2689,6 +2689,42 @@ SDValue SelectionDAG::CreateStackTemporary(EVT VT1, EVT VT2) {
   return CreateStackTemporary(Bytes, Align);
 }
 
+SDValue SelectionDAG::emitStackConvert(SDValue SrcOp, EVT SlotVT, EVT DestVT,
+                                       const SDLoc &DL, SDValue Chain) {
+  EVT SrcVT = SrcOp.getValueType();
+  Type *DestType = DestVT.getTypeForEVT(*getContext());
+  Align DestAlign = getDataLayout().getPrefTypeAlign(DestType);
+
+  // Create the stack frame object.
+  Align SrcAlign =
+      getDataLayout().getPrefTypeAlign(SrcVT.getTypeForEVT(*getContext()));
+  SDValue FIPtr = CreateStackTemporary(SlotVT.getStoreSize(), SrcAlign);
----------------
arsenm wrote:

IIRC CreateStackTemporary accounts for that part 

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


More information about the llvm-commits mailing list