[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
Mon Feb 17 02:01:56 PST 2020


djtodoro created this revision.
djtodoro added reviewers: vsk, aprantl.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
djtodoro added a child revision: D74614: [CSInfo][TailDuplicator] Update the call site info.

Needed for the D73534 <https://reviews.llvm.org/D73534>. All tests pass after applying the D73534 <https://reviews.llvm.org/D73534> again.

This is splitting of the D74614 <https://reviews.llvm.org/D74614>, but it should be revisited once again.


https://reviews.llvm.org/D74702

Files:
  llvm/lib/CodeGen/TailDuplicator.cpp


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.244928.patch
Type: text/x-patch
Size: 615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200217/9f4a19b0/attachment.bin>


More information about the llvm-commits mailing list