[llvm] d108fa0 - [LAA] Add tests with invariant accesses using vector types.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 06:53:32 PDT 2024
Author: Florian Hahn
Date: 2024-05-20T14:53:23+01:00
New Revision: d108fa03d4ac1a2634fa0a1e9b3058f4196f261c
URL: https://github.com/llvm/llvm-project/commit/d108fa03d4ac1a2634fa0a1e9b3058f4196f261c
DIFF: https://github.com/llvm/llvm-project/commit/d108fa03d4ac1a2634fa0a1e9b3058f4196f261c.diff
LOG: [LAA] Add tests with invariant accesses using vector types.
Extra tests for https://github.com/llvm/llvm-project/pull/92307
Added:
Modified:
llvm/test/Analysis/LoopAccessAnalysis/invariant-dependence-before.ll
Removed:
################################################################################
diff --git a/llvm/test/Analysis/LoopAccessAnalysis/invariant-dependence-before.ll b/llvm/test/Analysis/LoopAccessAnalysis/invariant-dependence-before.ll
index 2a210a5a445b9..1e16d89f69171 100644
--- a/llvm/test/Analysis/LoopAccessAnalysis/invariant-dependence-before.ll
+++ b/llvm/test/Analysis/LoopAccessAnalysis/invariant-dependence-before.ll
@@ -754,3 +754,73 @@ loop:
exit:
ret void
}
+
+define void @test_invar_vector_dependence_before_positive_strided_access_1(ptr %a) {
+; CHECK-LABEL: 'test_invar_vector_dependence_before_positive_strided_access_1'
+; CHECK-NEXT: loop:
+; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
+; CHECK-NEXT: Unknown data dependence.
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Unknown:
+; CHECK-NEXT: %l = load <4 x i8>, ptr %a, align 4 ->
+; CHECK-NEXT: store i32 0, ptr %gep, align 4
+; CHECK-EMPTY:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+;
+entry:
+ %gep.off = getelementptr i8, ptr %a, i32 4
+ br label %loop
+
+loop:
+ %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
+ %gep = getelementptr i32, ptr %gep.off, i32 %iv
+ %l = load <4 x i8>, ptr %a
+ store i32 0, ptr %gep
+ %iv.next = add i32 %iv, 1
+ %ec = icmp eq i32 %iv.next, 100
+ br i1 %ec, label %exit, label %loop
+
+exit:
+ ret void
+}
+
+define void @test_invar_scalable_dependence_before_positive_strided_access_1(ptr %a) {
+; CHECK-LABEL: 'test_invar_scalable_dependence_before_positive_strided_access_1'
+; CHECK-NEXT: loop:
+; CHECK-NEXT: Report: unsafe dependent memory operations in loop. Use #pragma clang loop distribute(enable) to allow loop distribution to attempt to isolate the offending operations into a separate loop
+; CHECK-NEXT: Unknown data dependence.
+; CHECK-NEXT: Dependences:
+; CHECK-NEXT: Unknown:
+; CHECK-NEXT: %l = load <vscale x 4 x i8>, ptr %a, align 4 ->
+; CHECK-NEXT: store i32 0, ptr %gep, align 4
+; CHECK-EMPTY:
+; CHECK-NEXT: Run-time memory checks:
+; CHECK-NEXT: Grouped accesses:
+; CHECK-EMPTY:
+; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
+; CHECK-NEXT: SCEV assumptions:
+; CHECK-EMPTY:
+; CHECK-NEXT: Expressions re-written:
+;
+entry:
+ %gep.off = getelementptr i8, ptr %a, i32 4
+ br label %loop
+
+loop:
+ %iv = phi i32 [ 0, %entry ], [ %iv.next, %loop ]
+ %gep = getelementptr i32, ptr %gep.off, i32 %iv
+ %l = load <vscale x 4 x i8>, ptr %a
+ store i32 0, ptr %gep
+ %iv.next = add i32 %iv, 1
+ %ec = icmp eq i32 %iv.next, 100
+ br i1 %ec, label %exit, label %loop
+
+exit:
+ ret void
+}
More information about the llvm-commits
mailing list