aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp b/contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
index df8df1e3a65d..c8ceebb8b8e6 100644
--- a/contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/X86/X86DynAllocaExpander.cpp
@@ -212,6 +212,12 @@ void X86DynAllocaExpander::lower(MachineInstr *MI, Lowering L) {
bool Is64BitAlloca = MI->getOpcode() == X86::DYN_ALLOCA_64;
assert(SlotSize == 4 || SlotSize == 8);
+ Optional<MachineFunction::DebugInstrOperandPair> InstrNum = None;
+ if (unsigned Num = MI->peekDebugInstrNum()) {
+ // Operand 2 of DYN_ALLOCAs contains the stack def.
+ InstrNum = {Num, 2};
+ }
+
switch (L) {
case TouchAndSub: {
assert(Amount >= SlotSize);
@@ -251,7 +257,7 @@ void X86DynAllocaExpander::lower(MachineInstr *MI, Lowering L) {
// Do the probe.
STI->getFrameLowering()->emitStackProbe(*MBB->getParent(), *MBB, MI, DL,
- /*InProlog=*/false);
+ /*InProlog=*/false, InstrNum);
} else {
// Sub
BuildMI(*MBB, I, DL,