summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-06-29 21:30:14 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-06-29 21:30:14 +0000
commitb7724b95d86df071c1b6f20ed2abe09a00374e31 (patch)
tree2e854e8c6c5ba715e709f807bd77f94ffd201472 /llvm/lib/Transforms
parent1a66ff70ed90f74f1780366d35cda32db61feba7 (diff)
downloadbcm5719-llvm-b7724b95d86df071c1b6f20ed2abe09a00374e31.tar.gz
bcm5719-llvm-b7724b95d86df071c1b6f20ed2abe09a00374e31.zip
[LoopSimplify] Set proper debug location in loop backedge blocks.
Set debug location for terminator instruction in loop backedge block (which is an unconditional jump to loop header). We can't copy debug location from original backedges, as there can be several of them, with different debug info locations. So, we follow the approach of SplitBlockPredecessors, and copy the debug info from first non-PHI instruction in the header (i.e. destination block). This is yet another change for PR23837. llvm-svn: 240999
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Utils/LoopSimplify.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
index d8f7c9176f5..2e7d21cb171 100644
--- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp
+++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp
@@ -386,8 +386,9 @@ static BasicBlock *insertUniqueBackedgeBlock(Loop *L, BasicBlock *Preheader,
// Create and insert the new backedge block...
BasicBlock *BEBlock = BasicBlock::Create(Header->getContext(),
- Header->getName()+".backedge", F);
+ Header->getName() + ".backedge", F);
BranchInst *BETerminator = BranchInst::Create(Header, BEBlock);
+ BETerminator->setDebugLoc(Header->getFirstNonPHI()->getDebugLoc());
DEBUG(dbgs() << "LoopSimplify: Inserting unique backedge block "
<< BEBlock->getName() << "\n");
OpenPOWER on IntegriCloud