summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index ac09ce5a347..03b73954321 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1373,14 +1373,6 @@ HoistTerminator:
}
}
- // As the parent basic block terminator is a branch instruction which is
- // removed at the end of the current transformation, use its previous
- // non-debug instruction, as the reference insertion point, which will
- // provide the debug location for generated select instructions. For BBs
- // with only debug instructions, use an empty debug location.
- Instruction *InsertPt =
- BIParent->getTerminator()->getPrevNonDebugInstruction();
-
// Okay, it is safe to hoist the terminator.
Instruction *NT = I1->clone();
BIParent->getInstList().insert(BI->getIterator(), NT);
@@ -1394,11 +1386,8 @@ HoistTerminator:
// it involves inlinable calls.
NT->applyMergedLocation(I1->getDebugLoc(), I2->getDebugLoc());
+ // PHIs created below will adopt NT's merged DebugLoc.
IRBuilder<NoFolder> Builder(NT);
- // If an earlier instruction in this BB had a location, adopt it, otherwise
- // clear debug locations.
- Builder.SetCurrentDebugLocation(InsertPt ? InsertPt->getDebugLoc()
- : DebugLoc());
// Hoisting one of the terminators from our successor is a great thing.
// Unfortunately, the successors of the if/else blocks may have PHI nodes in
OpenPOWER on IntegriCloud