[PATCH] D74702: [CSInfo][TailDuplicator] Delete the call site info when removing dead MBBs

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 01:37:08 PST 2020


djtodoro updated this revision to Diff 245097.
djtodoro added a comment.

- Add the '-debug-entry-values' into the tail-dup test


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74702/new/

https://reviews.llvm.org/D74702

Files:
  llvm/lib/CodeGen/TailDuplicator.cpp
  llvm/test/CodeGen/X86/tail-dup-repeat.ll


Index: llvm/test/CodeGen/X86/tail-dup-repeat.ll
===================================================================
--- llvm/test/CodeGen/X86/tail-dup-repeat.ll
+++ llvm/test/CodeGen/X86/tail-dup-repeat.ll
@@ -1,5 +1,5 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
+; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -debug-entry-values | FileCheck %s
 
 ; Function Attrs: uwtable
 ; When tail-duplicating during placement, we work backward from blocks with
Index: llvm/lib/CodeGen/TailDuplicator.cpp
===================================================================
--- llvm/lib/CodeGen/TailDuplicator.cpp
+++ llvm/lib/CodeGen/TailDuplicator.cpp
@@ -1015,6 +1015,13 @@
   assert(MBB->pred_empty() && "MBB must be dead!");
   LLVM_DEBUG(dbgs() << "\nRemoving MBB: " << *MBB);
 
+  MachineFunction *MF = MBB->getParent();
+  // Update the call site info.
+  std::for_each(MBB->begin(), MBB->end(), [MF](const MachineInstr &MI) {
+    if (MI.isCandidateForCallSiteEntry())
+      MF->eraseCallSiteInfo(&MI);
+  });
+
   if (RemovalCallback)
     (*RemovalCallback)(MBB);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74702.245097.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200218/a9a21426/attachment.bin>


More information about the llvm-commits mailing list