Skip to content

Commit dc23457

Browse files
committed
[LAA] Add additional test
1 parent 100b7a3 commit dc23457

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

llvm/test/Analysis/LoopAccessAnalysis/long-pointer-distance.ll

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
22
; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s
33

4-
define void @test(ptr %this, i128 %loop.limit) {
5-
; CHECK-LABEL: 'test'
4+
define void @forward_i128_offset_difference(ptr %this, i128 %loop.limit) {
5+
; CHECK-LABEL: 'forward_i128_offset_difference'
66
; CHECK-NEXT: loop:
77
; CHECK-NEXT: Memory dependences are safe
88
; CHECK-NEXT: Dependences:
@@ -35,3 +35,39 @@ exit:
3535
ret void
3636
}
3737

38+
define void @backward_distance_offset_subtract(ptr %A) {
39+
; CHECK-LABEL: 'backward_distance_offset_subtract'
40+
; CHECK-NEXT: loop:
41+
; CHECK-NEXT: Memory dependences are safe
42+
; CHECK-NEXT: Dependences:
43+
; CHECK-NEXT: Forward:
44+
; CHECK-NEXT: %l = load i32, ptr %gep.off.1, align 4 ->
45+
; CHECK-NEXT: store i32 %add, ptr %gep.off.2, align 4
46+
; CHECK-EMPTY:
47+
; CHECK-NEXT: Run-time memory checks:
48+
; CHECK-NEXT: Grouped accesses:
49+
; CHECK-EMPTY:
50+
; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
51+
; CHECK-NEXT: SCEV assumptions:
52+
; CHECK-EMPTY:
53+
; CHECK-NEXT: Expressions re-written:
54+
;
55+
entry:
56+
%A.off.1 = getelementptr inbounds i8, ptr %A, i64 u0x100000018
57+
%A.off.2 = getelementptr inbounds i8, ptr %A, i64 u0x100000010
58+
br label %loop
59+
60+
loop:
61+
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
62+
%gep.off.1 = getelementptr inbounds i32, ptr %A.off.1, i64 %iv
63+
%l = load i32, ptr %gep.off.1, align 4
64+
%add = add nsw i32 %l, 5
65+
%gep.off.2 = getelementptr inbounds i32, ptr %A.off.2, i64 %iv
66+
store i32 %add, ptr %gep.off.2, align 4
67+
%iv.next = add nuw nsw i64 %iv, 1
68+
%exitcond.not = icmp eq i64 %iv.next, 256
69+
br i1 %exitcond.not, label %exit, label %loop
70+
71+
exit:
72+
ret void
73+
}

0 commit comments

Comments
 (0)