[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
Wed Jun 10 01:03:29 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG6eb9eae0100f: [MS] Copy the symbols assigned to the former instruction when memory folding. (authored by pengfei).

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.269752.patch
Type: text/x-patch
Size: 1090 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200610/60433a78/attachment.bin>


More information about the llvm-commits mailing list