[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 03:35:30 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa5ac8ca3e0e4: [CSInfo][TailDuplicator] Delete the call site info when removing dead MBBs (authored by djtodoro).

Repository:
  rG LLVM Github Monorepo

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.245119.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200218/9e9d0abb/attachment.bin>


More information about the llvm-commits mailing list