File: nusw-predicates.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (120 lines) | stat: -rw-r--r-- 4,841 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes='print<access-info>' -disable-output %s 2>&1 | FileCheck %s

target datalayout = "p:16:16"

define void @int_and_pointer_predicate(ptr %v, i32 %N) {
; CHECK-LABEL: 'int_and_pointer_predicate'
; 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:            store i16 0, ptr %gep.iv.i16, align 1 ->
; CHECK-NEXT:            store i16 0, ptr %v, align 1
; 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-NEXT:      {0,+,1}<%loop> Added Flags: <nusw>
; CHECK-NEXT:      {%v,+,4}<%loop> Added Flags: <nusw>
; CHECK-EMPTY:
; CHECK-NEXT:      Expressions re-written:
;
entry:
  br label %loop

loop:
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %iv.i16 = trunc i64 %iv to i16
  %gep.iv.i16 = getelementptr { i16, i16 }, ptr %v, i16 %iv.i16
  store i16 0, ptr %gep.iv.i16, align 1
  store i16 0, ptr %v, align 1
  %iv.next = add i64 %iv, 1
  %iv.i32 = trunc i64 %iv to i32
  %.not = icmp ult i32 %N, %iv.i32
  br i1 %.not, label %exit, label %loop

exit:
  ret void
}

define void @int_and_multiple_pointer_predicates(ptr %v, ptr %w, i32 %N) {
; CHECK-LABEL: 'int_and_multiple_pointer_predicates'
; 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:            store i16 0, ptr %gep.v, align 1 ->
; CHECK-NEXT:            store i16 0, ptr %v, align 1
; CHECK-EMPTY:
; CHECK-NEXT:        Unknown:
; CHECK-NEXT:            store i16 0, ptr %gep.w, align 1 ->
; CHECK-NEXT:            store i16 0, ptr %w, align 1
; CHECK-EMPTY:
; CHECK-NEXT:      Run-time memory checks:
; CHECK-NEXT:      Check 0:
; CHECK-NEXT:        Comparing group ([[GRP1:0x[0-9a-f]+]]):
; CHECK-NEXT:        ptr %v
; CHECK-NEXT:        Against group ([[GRP2:0x[0-9a-f]+]]):
; CHECK-NEXT:        ptr %w
; CHECK-NEXT:      Check 1:
; CHECK-NEXT:        Comparing group ([[GRP1]]):
; CHECK-NEXT:        ptr %v
; CHECK-NEXT:        Against group ([[GRP3:0x[0-9a-f]+]]):
; CHECK-NEXT:          %gep.w = getelementptr { i16, i16 }, ptr %w, i16 %iv.i16
; CHECK-NEXT:      Check 2:
; CHECK-NEXT:        Comparing group ([[GRP4:0x[0-9a-f]+]]):
; CHECK-NEXT:          %gep.v = getelementptr { i16, i16 }, ptr %v, i16 %iv.i16
; CHECK-NEXT:        Against group ([[GRP2]]):
; CHECK-NEXT:        ptr %w
; CHECK-NEXT:      Check 3:
; CHECK-NEXT:        Comparing group ([[GRP4]]):
; CHECK-NEXT:          %gep.v = getelementptr { i16, i16 }, ptr %v, i16 %iv.i16
; CHECK-NEXT:        Against group ([[GRP3]]):
; CHECK-NEXT:          %gep.w = getelementptr { i16, i16 }, ptr %w, i16 %iv.i16
; CHECK-NEXT:      Grouped accesses:
; CHECK-NEXT:        Group [[GRP1]]:
; CHECK-NEXT:          (Low: %v High: (2 + %v))
; CHECK-NEXT:            Member: %v
; CHECK-NEXT:        Group [[GRP4]]:
; CHECK-NEXT:          (Low: %v High: (6 + (4 * (trunc i32 %N to i16)) + %v))
; CHECK-NEXT:            Member: {%v,+,4}<%loop>
; CHECK-NEXT:        Group [[GRP2]]:
; CHECK-NEXT:          (Low: %w High: (2 + %w))
; CHECK-NEXT:            Member: %w
; CHECK-NEXT:        Group [[GRP3]]:
; CHECK-NEXT:          (Low: %w High: (6 + (4 * (trunc i32 %N to i16)) + %w))
; CHECK-NEXT:            Member: {%w,+,4}<%loop>
; CHECK-EMPTY:
; CHECK-NEXT:      Non vectorizable stores to invariant address were not found in loop.
; CHECK-NEXT:      SCEV assumptions:
; CHECK-NEXT:      {0,+,1}<%loop> Added Flags: <nusw>
; CHECK-NEXT:      {%v,+,4}<%loop> Added Flags: <nusw>
; CHECK-NEXT:      {%w,+,4}<%loop> Added Flags: <nusw>
; CHECK-EMPTY:
; CHECK-NEXT:      Expressions re-written:
;
entry:
  br label %loop

loop:
  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
  %iv.i16 = trunc i64 %iv to i16
  %gep.v = getelementptr { i16, i16 }, ptr %v, i16 %iv.i16
  store i16 0, ptr %gep.v, align 1
  store i16 0, ptr %v, align 1
  %gep.w = getelementptr { i16, i16 }, ptr %w, i16 %iv.i16
  store i16 0, ptr %gep.w, align 1
  store i16 0, ptr %w, align 1
  %iv.next = add i64 %iv, 1
  %iv.i32 = trunc i64 %iv to i32
  %.not = icmp ult i32 %N, %iv.i32
  br i1 %.not, label %exit, label %loop

exit:
  ret void
}