diff options
author | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 20:07:49 +0000 |
---|---|---|
committer | Robert Lougher <rob.lougher@gmail.com> | 2016-12-14 20:07:49 +0000 |
commit | c9f73547769578473a8f0fbefcfbe8573441e6dd (patch) | |
tree | d11efe520214362cca0f0aa46e1c4aff4350b582 /llvm/lib/Transforms | |
parent | 418ed82eae376234b21083b86b28eac7f8685546 (diff) | |
download | bcm5719-llvm-c9f73547769578473a8f0fbefcfbe8573441e6dd.tar.gz bcm5719-llvm-c9f73547769578473a8f0fbefcfbe8573441e6dd.zip |
[InstCombine] Folding of a binop with RHS const should merge the debug locations
If all the operands to a phi node are a binop with 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 7 of 8 for D26256. Folding of a binop with RHS constant.
Differential Revision: https://reviews.llvm.org/D26256
llvm-svn: 289699
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 2c5b5f9d08f..5ef509cd9aa 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp @@ -576,7 +576,7 @@ Instruction *InstCombiner::FoldPHIArgOpIntoPHI(PHINode &PN) { for (unsigned i = 1, e = PN.getNumIncomingValues(); i != e; ++i) BinOp->andIRFlags(PN.getIncomingValue(i)); - BinOp->setDebugLoc(FirstInst->getDebugLoc()); + BinOp->setDebugLoc(PHIArgMergedDebugLoc(PN)); return BinOp; } |