The memory folding raplaced the old instruction without copying the symbols assigned. Which will resulted in built fail due to the lost symbols.
Reviewed by craig.topper
Differential Revision: https://reviews.llvm.org/D78471
Flags, MemSize, MFI.getObjectAlign(FI));
NewMI->addMemOperand(MF, MMO);
+ // The pass "x86 speculative load hardening" always attaches symbols to
+ // call instructions. We need copy it form old instruction.
+ NewMI->cloneInstrSymbols(MF, MI);
+
return NewMI;
}
define i32 @foo(void ()** %0) {
; CHECK-LABEL: foo:
-; CHECK-NOT: .Lslh_ret_addr0:
; CHECK: callq *(%{{.*}})
+; CHECK-NEXT: .Lslh_ret_addr0:
; CHECK-NEXT: movq %rsp, %rcx
; CHECK-NEXT: movq -{{[0-9]+}}(%rsp), %rax
; CHECK-NEXT: sarq $63, %rcx