summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorWolfgang Pieb <Wolfgang.Pieb@sony.com>2016-10-06 21:43:45 +0000
committerWolfgang Pieb <Wolfgang.Pieb@sony.com>2016-10-06 21:43:45 +0000
commite51bede1d8379311d836635eb2a0de49de850b9e (patch)
tree7d585fe8dae80bc688b5cfb12e487b9a1f8721f1 /llvm/lib/CodeGen
parent0509d047f4f1b742042b78426f84e48c94659ff5 (diff)
downloadbcm5719-llvm-e51bede1d8379311d836635eb2a0de49de850b9e.tar.gz
bcm5719-llvm-e51bede1d8379311d836635eb2a0de49de850b9e.zip
Preserve the debug location when CodeGenPrepare sinks a compare instruction into the
basic block of a user. Patch by Andrea DiBiagio. Differential Revision: https://reviews.llvm.org/D24632 llvm-svn: 283500
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index db5396a5bdd..cc4af1efba6 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -926,6 +926,8 @@ static bool SinkCmpExpression(CmpInst *CI, const TargetLowering *TLI) {
InsertedCmp =
CmpInst::Create(CI->getOpcode(), CI->getPredicate(),
CI->getOperand(0), CI->getOperand(1), "", &*InsertPt);
+ // Propagate the debug info.
+ InsertedCmp->setDebugLoc(CI->getDebugLoc());
}
// Replace a use of the cmp with a use of the new cmp.
OpenPOWER on IntegriCloud