Implement salavageDebugInfo functionality for SelectionDAG.
authorAdrian Prantl <aprantl@apple.com>
Tue, 24 Oct 2017 22:55:12 +0000 (22:55 +0000)
committerAdrian Prantl <aprantl@apple.com>
Tue, 24 Oct 2017 22:55:12 +0000 (22:55 +0000)
commit2eb7cbf987f21b4d573af41d11b327d7257d4fe2
tree537cf866e3bace697e9ed5da8173e15c44aaa7c8
parent4f00a71af56e9707711dd44d92f4a9216808076f
Implement salavageDebugInfo functionality for SelectionDAG.

Similar to how llvm::salvagDebugInfo hooks into InstCombine, this adds
a hook that can be invoked before an SDNode that is associated with an
SDDbgValue is erased to capture the effect of the deleted node in a
DIExpression.

The motivating example is an SDDebugValue attached to an ADD operation
that gets folded into a LOAD+OFFSET operation.

rdar://problem/32121503

llvm-svn: 316525
llvm/include/llvm/CodeGen/SelectionDAG.h
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/test/DebugInfo/X86/sdag-salvage-add.ll [new file with mode: 0644]