[CallSiteSplitting] Add debug location to created PHI nodes.
authorFlorian Hahn <florian.hahn@arm.com>
Tue, 11 Sep 2018 17:55:58 +0000 (17:55 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Tue, 11 Sep 2018 17:55:58 +0000 (17:55 +0000)
commit5b7e21a6b7e35cd8fba49efe7462e610d78c9314
tree6e5609b671e6c8097037b1d16d5d52b07c4cde5e
parentf446facab0e38c7496ac581f31335e60ec896cb9
[CallSiteSplitting] Add debug location to created PHI nodes.

There are 2 cases when we create PHI nodes:
 * For the result of the call that was duplicated in the split blocks.
   Those PHI nodes should have the debug location of the call.

 * For values produced before the call. Those instructions need to be
   duplicated in the split blocks and the PHI nodes should have the
   debug locations of those instructions.

Fixes PR37962.

Reviewers: junbuml, gbedwell, vsk

Reviewed By: junbuml

Tags: #debug-info

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

llvm-svn: 341970
llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll [new file with mode: 0644]