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

This is needed for the debug entry values feature.

Differential Revision: https://reviews.llvm.org/D74702
This commit is contained in:
Djordje Todorovic 2020-02-18 09:08:10 +01:00
parent 7fb06796ab
commit a5ac8ca3e0
2 changed files with 8 additions and 1 deletions

View File

@ -1015,6 +1015,13 @@ void TailDuplicator::removeDeadBlock(
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);

View File

@ -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