forked from llvm/llvm-project
- Notifications
You must be signed in to change notification settings - Fork 339
/
Copy pathselect-dependence.ll
87 lines (79 loc) · 3.24 KB
/
select-dependence.ll
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
; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes='print<access-info>' -disable-output 2>&1 < %s | FileCheck %s
definevoid@test(ptrnoalias%x, ptrnoalias%y, ptrnoalias%z) {
; CHECK-LABEL: 'test'
; 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: Unsafe indirect dependence.
; CHECK-NEXT: Dependences:
; CHECK-NEXT: IndirectUnsafe:
; CHECK-NEXT: %load = load double, ptr %gep.sel, align 8 ->
; CHECK-NEXT: store double %load, ptr %gep.sel2, align 8
; 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.y = getelementptrdouble, ptr%y, i64 -32
brlabel%loop
loop:
%iv = phii64 [ %iv.next, %loop ], [ 0, %entry ]
%icmp = icmpulei64%iv, 32
%sel = selecti1%icmp, ptr%x, ptr%gep.y
%gep.sel = getelementptrinboundsdouble, ptr%sel, i64%iv
%load = loaddouble, ptr%gep.sel, align8
%sel2 = selecti1%icmp, ptr%y, ptr%z
%gep.sel2 = getelementptrinboundsdouble, ptr%sel2, i64%iv
storedouble%load, ptr%gep.sel2, align8
%iv.next = addnuwnswi64%iv, 1
%exit.cond = icmpeqi64%iv, 94
bri1%exit.cond, label%exit, label%loop
exit:
retvoid
}
; Same as previous test, but with selects replaced by phis in the same block.
definevoid@test_phi(ptrnoalias%x, ptrnoalias%y, ptrnoalias%z) {
; CHECK-LABEL: 'test_phi'
; 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: Unsafe indirect dependence.
; CHECK-NEXT: Dependences:
; CHECK-NEXT: IndirectUnsafe:
; CHECK-NEXT: %load = load double, ptr %gep.sel, align 8 ->
; CHECK-NEXT: store double %load, ptr %gep.sel2, align 8
; 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.y = getelementptrdouble, ptr%y, i64 -32
brlabel%loop
loop:
%iv = phii64 [ %iv.next, %latch ], [ 0, %entry ]
%icmp = icmpulei64%iv, 32
bri1%icmp, label%if, label%latch
if:
brlabel%latch
latch:
%sel = phiptr [ %x, %if ], [ %gep.y, %loop ]
%sel2 = phiptr [ %y, %if ], [ %z, %loop ]
%gep.sel = getelementptrinboundsdouble, ptr%sel, i64%iv
%load = loaddouble, ptr%gep.sel, align8
%gep.sel2 = getelementptrinboundsdouble, ptr%sel2, i64%iv
storedouble%load, ptr%gep.sel2, align8
%iv.next = addnuwnswi64%iv, 1
%exit.cond = icmpeqi64%iv, 94
bri1%exit.cond, label%exit, label%loop
exit:
retvoid
}