DebugInfo: Avoid propagating incorrect debug locations in SelectionDAG via CSE.
authorWolfgang Pieb <Wolfgang_Pieb@playstation.sony.com>
Mon, 2 May 2016 22:50:51 +0000 (22:50 +0000)
committerWolfgang Pieb <Wolfgang_Pieb@playstation.sony.com>
Mon, 2 May 2016 22:50:51 +0000 (22:50 +0000)
commit56aa4b062954e34340f36b25f339448cfc888913
tree48e1252aa27711ff5ca25c966ce2564147ccf2dd
parentb8f0a4ea33bbc43839f36f9695ce84f2f9a35445
DebugInfo: Avoid propagating incorrect debug locations in SelectionDAG via CSE.

Summary:
When SelectionDAG performs CSE it is possible that the context's source
location is different from that of the selected node. This can lead to
incorrect line number records. We update the debug location to the
one that occurs earlier in the instruction sequence.

This fixes PR21006.

Reviewers: echristo, sdmitrouk

Subscribers: jevinskie, asl, llvm-commits

Differential Revision: http://reviews.llvm.org/D12094

llvm-svn: 268323
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/test/DebugInfo/Generic/isel-cse-line.ll [new file with mode: 0644]