diff options
author | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 19:24:01 +0000 |
---|---|---|
committer | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 19:24:01 +0000 |
commit | f02d9b8325b8c85e8347a7d2ec82d02749d8df5b (patch) | |
tree | ea25151656e6af0b9b165753ab7d26bb5b4a1945 /llvm/lib/Transforms | |
parent | 64aec507e84bd04f7bd152bd06887d484cc89179 (diff) | |
download | bcm5719-llvm-f02d9b8325b8c85e8347a7d2ec82d02749d8df5b.tar.gz bcm5719-llvm-f02d9b8325b8c85e8347a7d2ec82d02749d8df5b.zip |
[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
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp index 47f110d60f2..2c5b5f9d08f 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -565,7 +565,7 @@ Instruction *InstCombiner::FoldPHIArgOpIntoPHI(PHINode &PN) { if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst)) { CastInst *NewCI = CastInst::Create(FirstCI->getOpcode(), PhiVal, PN.getType()); - NewCI->setDebugLoc(FirstInst->getDebugLoc()); + NewCI->setDebugLoc(PHIArgMergedDebugLoc(PN)); return NewCI; } |