diff options
author | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 18:14:57 +0000 |
---|---|---|
committer | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 18:14:57 +0000 |
commit | 4b0790d488db749fa3ec545d7d833a7cea603035 (patch) | |
tree | cefd85e0cbf05d8b1c21cbf9d4ed55880ac730bc /llvm/lib/Transforms | |
parent | d9d9a545119d6538a94e90989c5cf0147cb02a8a (diff) | |
download | bcm5719-llvm-4b0790d488db749fa3ec545d7d833a7cea603035.tar.gz bcm5719-llvm-4b0790d488db749fa3ec545d7d833a7cea603035.zip |
[InstCombine] Merge debug locations when folding through a phi node
If all the operands to a phi node are of the same operation, instcombine
will try to pull them through the phi node, combining them into a single
operation. When it does this, the debug location of the operation should
be the merged debug locations of the phi node arguments.
Patch 3 of 8 for D26256. Folding of a compare operation.
Differential Revision: https://reviews.llvm.org/D26256
llvm-svn: 289681
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 91bfe6c5c82..c288886fafb 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -117,7 +117,7 @@ Instruction *InstCombiner::FoldPHIArgBinOpIntoPHI(PHINode &PN) { if (CmpInst *CIOp = dyn_cast<CmpInst>(FirstInst)) { CmpInst *NewCI = CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), LHSVal, RHSVal); - NewCI->setDebugLoc(FirstInst->getDebugLoc()); + NewCI->setDebugLoc(PHIArgMergedDebugLoc(PN)); return NewCI; } |