This is an archive of the discontinued LLVM Phabricator instance.

[BranchFolding] Update debug location along with the update of branch instruction.
ClosedPublic

Authored by twoh on Feb 13 2017, 12:11 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

twoh created this revision.Feb 13 2017, 12:11 PM
twoh updated this revision to Diff 88621.Feb 15 2017, 4:10 PM

Use MachineBasicBlock::findBranchDebugLoc instead of getBranchDebugLoc

twoh added a comment.Feb 20 2017, 8:08 AM

Ping. Thanks!

aprantl accepted this revision.Feb 20 2017, 10:50 AM

With the caveat of my limited understanding of BranchFolding this seems reasonable. Thanks!

This revision is now accepted and ready to land.Feb 20 2017, 10:50 AM
This revision was automatically updated to reflect the committed changes.