1
+ ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
1
2
; RUN: opt -passes='print<access-info>' -disable-output < %s 2>&1 | FileCheck %s
2
3
3
4
; This is the test case from PR26314.
4
- ; When we were retrying dependence checking with memchecks only,
5
- ; the loop-invariant access in the inner loop was incorrectly determined to be wrapping
5
+ ; When we were retrying dependence checking with memchecks only,
6
+ ; the loop-invariant access in the inner loop was incorrectly determined to be wrapping
6
7
; because it was not strided in the inner loop.
7
-
8
+
8
9
; #define Z 32
9
10
; typedef struct s {
10
11
; int v1[Z];
21
22
; }
22
23
; }
23
24
24
- ; CHECK: function 'Test':
25
- ; CHECK: .inner:
26
- ; CHECK-NEXT: Memory dependences are safe with run-time checks
27
- ; CHECK-NEXT: Dependences:
28
- ; CHECK-NEXT: Run-time memory checks:
29
- ; CHECK: Check 0:
30
- ; CHECK: Check 1:
31
-
32
25
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33
26
34
27
%struct.s = type { [32 x i32 ], [32 x i32 ], [32 x [32 x i32 ]] }
35
28
36
29
define void @Test (ptr nocapture %obj , i64 %z ) #0 {
30
+ ; CHECK-LABEL: 'Test'
31
+ ; CHECK-NEXT: .inner:
32
+ ; CHECK-NEXT: Memory dependences are safe with a maximum safe vector width of 2048 bits with run-time checks
33
+ ; CHECK-NEXT: Dependences:
34
+ ; CHECK-NEXT: Run-time memory checks:
35
+ ; CHECK-NEXT: Check 0:
36
+ ; CHECK-NEXT: Comparing group ([[GRP1:0x[0-9a-f]+]]):
37
+ ; CHECK-NEXT: %6 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 2, i64 %i, i64 %j
38
+ ; CHECK-NEXT: Against group ([[GRP2:0x[0-9a-f]+]]):
39
+ ; CHECK-NEXT: %2 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 0, i64 %j
40
+ ; CHECK-NEXT: Check 1:
41
+ ; CHECK-NEXT: Comparing group ([[GRP1]]):
42
+ ; CHECK-NEXT: %6 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 2, i64 %i, i64 %j
43
+ ; CHECK-NEXT: Against group ([[GRP3:0x[0-9a-f]+]]):
44
+ ; CHECK-NEXT: %1 = getelementptr inbounds %struct.s, ptr %obj, i64 0, i32 1, i64 %i
45
+ ; CHECK-NEXT: Grouped accesses:
46
+ ; CHECK-NEXT: Group [[GRP1]]:
47
+ ; CHECK-NEXT: (Low: {(256 + %obj)<nuw>,+,128}<nuw><%.outer.preheader> High: {(256 + (4 * %z) + %obj),+,128}<nw><%.outer.preheader>)
48
+ ; CHECK-NEXT: Member: {{\{\{}}(256 + %obj)<nuw>,+,128}<nuw><%.outer.preheader>,+,4}<nuw><%.inner>
49
+ ; CHECK-NEXT: Group [[GRP2]]:
50
+ ; CHECK-NEXT: (Low: %obj High: ((4 * %z) + %obj))
51
+ ; CHECK-NEXT: Member: {%obj,+,4}<nuw><%.inner>
52
+ ; CHECK-NEXT: Group [[GRP3]]:
53
+ ; CHECK-NEXT: (Low: {(128 + %obj)<nuw>,+,4}<nuw><%.outer.preheader> High: {(132 + %obj),+,4}<nw><%.outer.preheader>)
54
+ ; CHECK-NEXT: Member: {(128 + %obj)<nuw>,+,4}<nuw><%.outer.preheader>
55
+ ; CHECK-EMPTY:
56
+ ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
57
+ ; CHECK-NEXT: SCEV assumptions:
58
+ ; CHECK-EMPTY:
59
+ ; CHECK-NEXT: Expressions re-written:
60
+ ; CHECK-NEXT: .outer.preheader:
61
+ ; CHECK-NEXT: Report: loop is not the innermost loop
62
+ ; CHECK-NEXT: Dependences:
63
+ ; CHECK-NEXT: Run-time memory checks:
64
+ ; CHECK-NEXT: Grouped accesses:
65
+ ; CHECK-EMPTY:
66
+ ; CHECK-NEXT: Non vectorizable stores to invariant address were not found in loop.
67
+ ; CHECK-NEXT: SCEV assumptions:
68
+ ; CHECK-EMPTY:
69
+ ; CHECK-NEXT: Expressions re-written:
70
+ ;
37
71
br label %.outer.preheader
38
72
39
73
@@ -44,7 +78,7 @@ define void @Test(ptr nocapture %obj, i64 %z) #0 {
44
78
45
79
.exit:
46
80
ret void
47
-
81
+
48
82
.outer:
49
83
%i.next = add nuw nsw i64 %i , 1
50
84
%exitcond.outer = icmp eq i64 %i.next , 32
@@ -59,7 +93,7 @@ define void @Test(ptr nocapture %obj, i64 %z) #0 {
59
93
%6 = getelementptr inbounds %struct.s , ptr %obj , i64 0 , i32 2 , i64 %i , i64 %j
60
94
%7 = load i32 , ptr %6
61
95
%8 = add nsw i32 %5 , %7
62
- store i32 %8 , ptr %6
96
+ store i32 %8 , ptr %6
63
97
%j.next = add nuw nsw i64 %j , 1
64
98
%exitcond.inner = icmp eq i64 %j.next , %z
65
99
br i1 %exitcond.inner , label %.outer , label %.inner
0 commit comments