[PATCH] D78471: [MS] Copy the symbols assigned to the former instruction when memory folding.
Pengfei Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 18 02:38:17 PDT 2020
pengfei updated this revision to Diff 264566.
pengfei added a comment.
Address review comment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78471/new/
https://reviews.llvm.org/D78471
Files:
llvm/lib/CodeGen/TargetInstrInfo.cpp
llvm/test/CodeGen/X86/speculative-load-hardening-no-spill.ll
Index: llvm/test/CodeGen/X86/speculative-load-hardening-no-spill.ll
===================================================================
--- llvm/test/CodeGen/X86/speculative-load-hardening-no-spill.ll
+++ llvm/test/CodeGen/X86/speculative-load-hardening-no-spill.ll
@@ -2,8 +2,8 @@
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
Index: llvm/lib/CodeGen/TargetInstrInfo.cpp
===================================================================
--- llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -597,6 +597,10 @@
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;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78471.264566.patch
Type: text/x-patch
Size: 1090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200518/549eb60c/attachment.bin>
More information about the llvm-commits
mailing list