[LoopSimplify] Set proper debug location in loop backedge blocks.
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 29 Jun 2015 21:30:14 +0000 (21:30 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 29 Jun 2015 21:30:14 +0000 (21:30 +0000)
commit93dd711033a224fb54de157fd5270967627affe5
tree9ed9f1fcf614fa6a09eeea0bee46f3e2223b51fa
parent35f25f9d7e571b3ad64202bba22b94e501088ad9
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240999 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/LoopSimplify.cpp
test/Transforms/LoopSimplify/single-backedge.ll