[llvm] x86: fix musttail sibcall miscompilation (PR #168956)

Folkert de Vries via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 5 13:35:15 PST 2025


================

----------------
folkertdev wrote:

We are, because the `auto *SrcFrameIdxNode = dyn_cast<FrameIndexSDNode>(Src);` produces a NULL pointer in `ByValNeedsCopyForTailCall`. The `Src` value is apparently a `t7: i32,ch = CopyFromReg t0, Register:i32 %2`. 

I don't really know what that means, is there a straightforward way to make that check more permissive?

Also I see how `MFI.CreateStackObject` would create a stack object (and causes the `subl` and `addl`, but apparently the actual copy is optimized out?

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


More information about the llvm-commits mailing list