[InstCombine] When folding casts through a phi node merge the debug locations
authorRobert Lougher <rob.lougher@gmail.com>
Wed, 14 Dec 2016 19:24:01 +0000 (19:24 +0000)
committerRobert Lougher <rob.lougher@gmail.com>
Wed, 14 Dec 2016 19:24:01 +0000 (19:24 +0000)
commitf02d9b8325b8c85e8347a7d2ec82d02749d8df5b
treeea25151656e6af0b9b165753ab7d26bb5b4a1945
parent64aec507e84bd04f7bd152bd06887d484cc89179
[InstCombine] When folding casts through a phi node merge the debug locations

If all the operands to a phi node are a cast, instcombine will try to pull
them through the phi node, combining them into a single cast. When it does
this, the debug location of the new cast should be the merged debug locations
of the phi node arguments.

Patch 6 of 8 for D26256.  Folding of a cast operation.

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

llvm-svn: 289693
llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
llvm/test/DebugInfo/Generic/instcombine-phi.ll