summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>2018-10-10 08:29:55 +0000
committerCarlos Alberto Enciso <carlos.alberto.enciso@gmail.com>2018-10-10 08:29:55 +0000
commite7a347e5f89e0484bea76f67197a8c50d0abb313 (patch)
tree21c6a1e5ad3119dca484d78a4f13b6d53a46c2ac /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parent6e357123ed12e52fb93310594e495607335fbe84 (diff)
downloadbcm5719-llvm-e7a347e5f89e0484bea76f67197a8c50d0abb313.tar.gz
bcm5719-llvm-e7a347e5f89e0484bea76f67197a8c50d0abb313.zip
[DebugInfo][Dexter] Unreachable line stepped onto after SimplifyCFG.
When SimplifyCFG changes the PHI node into a select instruction, the debug line records becomes ambiguous. It causes the debugger to display unreachable source lines. Differential Revision: https://reviews.llvm.org/D52887 llvm-svn: 344120
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index ebbcf800254..3e73c537292 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2375,24 +2375,10 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetTransformInfo &TTI,
// Move all 'aggressive' instructions, which are defined in the
// conditional parts of the if's up to the dominating block.
- if (IfBlock1) {
- for (auto &I : *IfBlock1) {
- I.dropUnknownNonDebugMetadata();
- dropDebugUsers(I);
- }
- DomBlock->getInstList().splice(InsertPt->getIterator(),
- IfBlock1->getInstList(), IfBlock1->begin(),
- IfBlock1->getTerminator()->getIterator());
- }
- if (IfBlock2) {
- for (auto &I : *IfBlock2) {
- I.dropUnknownNonDebugMetadata();
- dropDebugUsers(I);
- }
- DomBlock->getInstList().splice(InsertPt->getIterator(),
- IfBlock2->getInstList(), IfBlock2->begin(),
- IfBlock2->getTerminator()->getIterator());
- }
+ if (IfBlock1)
+ hoistAllInstructionsInto(DomBlock, InsertPt, IfBlock1);
+ if (IfBlock2)
+ hoistAllInstructionsInto(DomBlock, InsertPt, IfBlock2);
while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) {
// Change the PHI node into a select instruction.
OpenPOWER on IntegriCloud