[llvm] 6c98f70 - [LV] Add test with missing debug location for pointer IV in vector loop.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 06:36:18 PST 2024


Author: Florian Hahn
Date: 2024-12-15T14:36:03Z
New Revision: 6c98f70b30408916de6ad5cb82081ca7d9b1c39e

URL: https://github.com/llvm/llvm-project/commit/6c98f70b30408916de6ad5cb82081ca7d9b1c39e
DIFF: https://github.com/llvm/llvm-project/commit/6c98f70b30408916de6ad5cb82081ca7d9b1c39e.diff

LOG: [LV] Add test with missing debug location for pointer IV in vector loop.

Added: 
    

Modified: 
    llvm/test/Transforms/LoopVectorize/preserve-dbg-loc-and-loop-metadata.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LoopVectorize/preserve-dbg-loc-and-loop-metadata.ll b/llvm/test/Transforms/LoopVectorize/preserve-dbg-loc-and-loop-metadata.ll
index 9cb9a2e93d0a9e..7da389a4fb2d21 100644
--- a/llvm/test/Transforms/LoopVectorize/preserve-dbg-loc-and-loop-metadata.ll
+++ b/llvm/test/Transforms/LoopVectorize/preserve-dbg-loc-and-loop-metadata.ll
@@ -1,16 +1,19 @@
-; RUN: opt < %s -passes=loop-vectorize -S 2>&1 | FileCheck %s
-; RUN: opt < %s -passes=debugify,loop-vectorize -S | FileCheck %s -check-prefix DEBUGLOC
-; RUN: opt < %s -passes=debugify,loop-vectorize -S --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix DEBUGLOC
+; RUN: opt < %s -passes=loop-vectorize -force-vector-width=4 -S 2>&1 | FileCheck %s
+; RUN: opt < %s -passes=debugify,loop-vectorize -force-vector-width=4 -S | FileCheck %s -check-prefix DEBUGLOC
+; RUN: opt < %s -passes=debugify,loop-vectorize -force-vector-width=4 -S --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix DEBUGLOC
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
 ; This test makes sure we don't duplicate the loop vectorizer's metadata
 ; while marking them as already vectorized (by setting width = 1), even
 ; at lower optimization levels, where no extra cleanup is done
 
-; DEBUGLOC-LABEL: define void @_Z3fooPf(
 ; Check that the phi to resume the scalar part of the loop
 ; has Debug Location.
 define void @_Z3fooPf(ptr %a) {
+; DEBUGLOC-LABEL: define void @_Z3fooPf(
+; DEBUGLOC: scalar.ph:
+; DEBUGLOC-NEXT:    %bc.resume.val = phi {{.*}} !dbg ![[RESUMELOC:[0-9]+]]
+;
 entry:
   br label %for.body
 
@@ -24,16 +27,35 @@ for.body:                                         ; preds = %for.body, %entry
   %exitcond = icmp eq i64 %indvars.iv.next, 1024
   br i1 %exitcond, label %for.end, label %for.body, !llvm.loop !0
 
-; DEBUGLOC: scalar.ph:
-; DEBUGLOC-NEXT:    %bc.resume.val = phi {{.*}} !dbg ![[DbgLoc:[0-9]+]]
+for.end:                                          ; preds = %for.body
+  ret void
+}
+
+; FIXME: Missing debug location for pointer induction in vector loop
+define void @widen_ptr_induction_dbg(ptr %start, ptr %end) {
+; DEBUGLOC-LABEL: define void @widen_ptr_induction_dbg(
+; DEBUGLOC: vector.body:
+; DEBUGLOC-NOT: = phi ptr {{.+}}, !dbg
+; DEBUGLOC: = phi i64
 ;
-; DEBUGLOC: ![[DbgLoc]] = !DILocation(line: 2
+entry:
+  br label %loop
 
-for.end:                                          ; preds = %for.body
+loop:
+  %iv = phi ptr [ %start, %entry ], [ %iv.next, %loop ]
+  %iv.next = getelementptr inbounds ptr, ptr %iv, i64 1
+  store ptr %iv, ptr %iv, align 1
+  %cmp.not = icmp eq ptr %iv.next, %end
+  br i1 %cmp.not, label %exit, label %loop
+
+exit:
   ret void
 }
 
+
 !0 = !{!0, !1}
 !1 = !{!"llvm.loop.vectorize.width", i32 4}
 ; CHECK-NOT: !{metadata !"llvm.loop.vectorize.width", i32 4}
 ; CHECK: !{!"llvm.loop.isvectorized", i32 1}
+
+; DEBUGLOC: ![[RESUMELOC]] = !DILocation(line: 2


        


More information about the llvm-commits mailing list