aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorNikola Prica <nikola.prica@rt-rk.com>2019-10-08 15:43:12 +0000
committerNikola Prica <nikola.prica@rt-rk.com>2019-10-08 15:43:12 +0000
commit98603a815308626fafdba930f69333da13ecc31e (patch)
tree3ea353dcf96d8e7c2543cef5c418e9e29a3a5a3c /llvm/lib/CodeGen/BranchFolding.cpp
parent41ff39605ea1c9278f6ff15208475f5f3c863f44 (diff)
downloadllvm-98603a815308626fafdba930f69333da13ecc31e.zip
llvm-98603a815308626fafdba930f69333da13ecc31e.tar.gz
llvm-98603a815308626fafdba930f69333da13ecc31e.tar.bz2
[DebugInfo][If-Converter] Update call site info during the optimization
During the If-Converter optimization pay attention when copying or deleting call instructions in order to keep call site information in valid state. Reviewers: aprantl, vsk, efriedma Reviewed By: vsk, efriedma Differential Revision: https://reviews.llvm.org/D66955 llvm-svn: 374068
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index b0d1599..455916e 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -162,6 +162,11 @@ void BranchFolder::RemoveDeadBlock(MachineBasicBlock *MBB) {
// Avoid matching if this pointer gets reused.
TriedMerging.erase(MBB);
+ // Update call site info.
+ std::for_each(MBB->begin(), MBB->end(), [MF](const MachineInstr &MI) {
+ if (MI.isCall(MachineInstr::IgnoreBundle))
+ MF->eraseCallSiteInfo(&MI);
+ });
// Remove the block.
MF->erase(MBB);
EHScopeMembership.erase(MBB);