summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/LoopVectorize/debugloc.ll
diff options
context:
space:
mode:
authorOrlando Cazalet-Hyams <orlando.hyams@sony.com>2019-05-07 15:37:38 +0000
committerOrlando Cazalet-Hyams <orlando.hyams@sony.com>2019-05-07 15:37:38 +0000
commit78a6062c24dc51180101666b82afa8d7fab920d1 (patch)
tree7b4b64e5b211da4c39fdd123e8fa6cbe0c3e5467 /llvm/test/Transforms/LoopVectorize/debugloc.ll
parenteeed7ee2cc7cbd49a906bed05a69140647ebb6d2 (diff)
downloadbcm5719-llvm-78a6062c24dc51180101666b82afa8d7fab920d1.tar.gz
bcm5719-llvm-78a6062c24dc51180101666b82afa8d7fab920d1.zip
[DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion
Summary: Bug: https://bugs.llvm.org/show_bug.cgi?id=39024 The bug reports that a vectorized loop is stepped through 4 times and each step through the loop seemed to show a different path. I found two problems here: A) An incorrect line number on a preheader block (for.body.preheader) instruction causes a step into the loop before it begins. B) Instructions in the middle block have different line numbers which give the impression of another iteration. In this patch I give all of the middle block instructions the line number of the scalar loop latch terminator branch. This seems to provide the smoothest debugging experience because the vectorized loops will always end on this line before dropping into the scalar loop. To solve problem A I have altered llvm::SplitBlockPredecessors to accommodate loop header blocks. Reviewers: samsonov, vsk, aprantl, probinson, anemet, hfinkel Reviewed By: hfinkel Subscribers: bjope, jmellorcrummey, hfinkel, gbedwell, hiraditya, zzheng, llvm-commits Tags: #llvm, #debug-info Differential Revision: https://reviews.llvm.org/D60831 llvm-svn: 360162
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize/debugloc.ll')
-rw-r--r--llvm/test/Transforms/LoopVectorize/debugloc.ll9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/debugloc.ll b/llvm/test/Transforms/LoopVectorize/debugloc.ll
index e9ec8662ce4..358f49b9926 100644
--- a/llvm/test/Transforms/LoopVectorize/debugloc.ll
+++ b/llvm/test/Transforms/LoopVectorize/debugloc.ll
@@ -14,8 +14,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
; CHECK: add i64 %index, 2, !dbg ![[LOC]]
; CHECK: icmp eq i64 %index.next, %n.vec, !dbg ![[LOC]]
; CHECK: middle.block
-; CHECK: add <2 x i32> %{{.*}}, %rdx.shuf, !dbg ![[LOC]]
-; CHECK: extractelement <2 x i32> %bin.rdx, i32 0, !dbg ![[LOC]]
+; CHECK: add <2 x i32> %{{.*}}, %rdx.shuf, !dbg ![[BR_LOC:[0-9]+]]
+; CHECK: extractelement <2 x i32> %bin.rdx, i32 0, !dbg ![[BR_LOC]]
+; CHECK: for.body
+; CHECK br i1{{.*}}, label %for.body,{{.*}}, !dbg ![[BR_LOC]],
+; CHECK: ![[BR_LOC]] = !DILocation(line: 5,
define i32 @f(i32* nocapture %a, i32 %size) #0 !dbg !4 {
entry:
@@ -38,7 +41,7 @@ for.body: ; preds = %for.body.lr.ph, %fo
%indvars.iv.next = add i64 %indvars.iv, 1, !dbg !22
call void @llvm.dbg.value(metadata !{null}, metadata !16, metadata !DIExpression()), !dbg !22
%lftr.wideiv = trunc i64 %indvars.iv.next to i32, !dbg !22
- %exitcond = icmp ne i32 %lftr.wideiv, %size, !dbg !22
+ %exitcond = icmp ne i32 %lftr.wideiv, %size, !dbg !21
br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge, !dbg !21
for.cond.for.end_crit_edge: ; preds = %for.body
OpenPOWER on IntegriCloud