diff options
author | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 20:27:22 +0000 |
---|---|---|
committer | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 20:27:22 +0000 |
commit | cfd719869848b82a4e325f9d87fd95dcce3f57a4 (patch) | |
tree | affacdb4445880cea713b4aa922fc45fc400398d /llvm/lib/Transforms | |
parent | 10576e73c9a814d06cc86ff2b35ceae6dbc7af85 (diff) | |
download | bcm5719-llvm-cfd719869848b82a4e325f9d87fd95dcce3f57a4.tar.gz bcm5719-llvm-cfd719869848b82a4e325f9d87fd95dcce3f57a4.zip |
[InstCombine] Folding of a compare with RHS const should merge debug locations
If all the operands to a phi node are compares that have a RHS constant,
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 new op
should be the merged debug locations of the phi node arguments.
Patch 8 of 8 for D26256. Folding of a compare that has a RHS constant.
Differential Revision: https://reviews.llvm.org/D26256
llvm-svn: 289704
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 5ef509cd9aa..184897f751f 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -583,7 +583,7 @@ Instruction *InstCombiner::FoldPHIArgOpIntoPHI(PHINode &PN) { CmpInst *CIOp = cast<CmpInst>(FirstInst); CmpInst *NewCI = CmpInst::Create(CIOp->getOpcode(), CIOp->getPredicate(), PhiVal, ConstantOp); - NewCI->setDebugLoc(FirstInst->getDebugLoc()); + NewCI->setDebugLoc(PHIArgMergedDebugLoc(PN)); return NewCI; } |