summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-07-04 10:16:55 +0000
committerAnastasis Grammenos <anastasis.gramm2@gmail.com>2018-07-04 10:16:55 +0000
commit204726b34551429a80e888cdd20d3235c7d93868 (patch)
tree4bb23189eedc48e62c1f8f2152b62e6f7f59cefe /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parentf5ba09f74bc44c83cd2578e793402eb9d6b977b8 (diff)
downloadbcm5719-llvm-204726b34551429a80e888cdd20d3235c7d93868.tar.gz
bcm5719-llvm-204726b34551429a80e888cdd20d3235c7d93868.zip
[DebugInfo][LoopVectorize] Preserve DL in generated phi instruction
When creating `phi` instructions to resume at the scalar part of the loop, copy the DebugLoc from the original phi over to the new one. Differential Revision: https://reviews.llvm.org/D48769 llvm-svn: 336256
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 8a0d96a9411..16c40b99c3a 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -2912,6 +2912,8 @@ BasicBlock *InnerLoopVectorizer::createVectorizedLoopSkeleton() {
// Create phi nodes to merge from the backedge-taken check block.
PHINode *BCResumeVal = PHINode::Create(
OrigPhi->getType(), 3, "bc.resume.val", ScalarPH->getTerminator());
+ // Copy original phi DL over to the new one.
+ BCResumeVal->setDebugLoc(OrigPhi->getDebugLoc());
Value *&EndValue = IVEndValues[OrigPhi];
if (OrigPhi == OldInduction) {
// We know what the end value is.
OpenPOWER on IntegriCloud