]> granicus.if.org Git - llvm/commit
[BranchFolding] Update debug location along with the update of branch instruction.
authorTaewook Oh <twoh@fb.com>
Tue, 21 Feb 2017 00:12:38 +0000 (00:12 +0000)
committerTaewook Oh <twoh@fb.com>
Tue, 21 Feb 2017 00:12:38 +0000 (00:12 +0000)
commitf8bacbb9bd434262f49c9e002c6ca57995347950
treea8423aa3a37a14f624e4c6398f92161b01c2295d
parentb7493bfcdae0a94f8adce1cfb05bc3744ac07bad
[BranchFolding] Update debug location along with the update of branch instruction.

Summary:
Currently, BranchFolder drops DebugLoc for branch instructions in some places. For example, for the test code attached, the branch instruction of 'entry' block has a DILocation of

```
!12 = !DILocation(line: 6, column: 3, scope: !11)
```

, but this information is gone when then block is lowered because BranchFolder misses it. This patch is a fix for this issue.

Reviewers: qcolombet, aprantl, craig.topper, MatzeB

Reviewed By: aprantl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29902

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295684 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BranchFolding.cpp
test/CodeGen/X86/branchfolding-debugloc.ll [new file with mode: 0644]