summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/UnreachableBlockElim.cpp
diff options
context:
space:
mode:
authorDavid Stenberg <david.stenberg@ericsson.com>2019-08-12 13:22:29 +0000
committerDavid Stenberg <david.stenberg@ericsson.com>2019-08-12 13:22:29 +0000
commit9b29ec58b70e988e12be03044ef71e30895608f2 (patch)
tree87aedd47f06e6adc10f594c5ced3758e4934d135 /llvm/lib/CodeGen/UnreachableBlockElim.cpp
parent342fb0db6d98d43252cbaeb6123cd154976c42aa (diff)
downloadbcm5719-llvm-9b29ec58b70e988e12be03044ef71e30895608f2.tar.gz
bcm5719-llvm-9b29ec58b70e988e12be03044ef71e30895608f2.zip
[DebugInfo] Remove call sites when eliminating unreachable blocks
Summary: When eliminating an unreachable block we must remove any call site information for calls residing in the block. This was originally found on a downstream target, and the attached x86 test case was produced by hand-modifying some MIR. Reviewers: aprantl, asowda, NikolaPrica, djtodoro, ivanbaev, vsk Reviewed By: NikolaPrica, vsk Subscribers: vsk, hiraditya, llvm-commits Tags: #debug-info, #llvm Differential Revision: https://reviews.llvm.org/D64500 llvm-svn: 368566
Diffstat (limited to 'llvm/lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r--llvm/lib/CodeGen/UnreachableBlockElim.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
index 177bab32bcc..c5343690329 100644
--- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
@@ -146,8 +146,14 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
}
// Actually remove the blocks now.
- for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i)
+ for (unsigned i = 0, e = DeadBlocks.size(); i != e; ++i) {
+ // Remove any call site information for calls in the block.
+ for (auto &I : DeadBlocks[i]->instrs())
+ if (I.isCall(MachineInstr::IgnoreBundle))
+ DeadBlocks[i]->getParent()->updateCallSiteInfo(&I);
+
DeadBlocks[i]->eraseFromParent();
+ }
// Cleanup PHI nodes.
for (MachineFunction::iterator I = F.begin(), E = F.end(); I != E; ++I) {
OpenPOWER on IntegriCloud