[llvm] [X86] Don't fold loads from non-fixed stack objects into tail calls (PR #221243)

Akash Manna via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 19:48:46 PDT 2026


================
@@ -3682,7 +3683,39 @@ static bool mayUseCarryFlag(X86::CondCode CC) {
   return true;
 }
 
+/// Return true if \p Addr may be matched with a non-fixed frame index as base.
+static bool addrMayUseNonFixedFrameIndex(SDValue Addr,
+                                         const MachineFrameInfo &MFI,
+                                         unsigned Depth = 0) {
+  if (auto *FI = dyn_cast<FrameIndexSDNode>(Addr))
+    return !MFI.isFixedObjectIndex(FI->getIndex());
+  if (Depth >= SelectionDAG::MaxRecursionDepth)
+    return true;
----------------
akash-manna-sky wrote:

Comments added. 

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


More information about the llvm-commits mailing list