Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: tests_lit/llvm2ice_tests/loop-nest-depth.ll

Issue 1318553003: Compute the loop nest depth of each CfgNode and weight Variables by it. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: calculate -> compute (consistency) Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 ; Test the the loop nest depth is correctly calculated for basic blocks.
2
jvoung (off chromium) 2015/09/01 18:56:18 Can you check that this works with "make -f Makefi
ascull 2015/09/03 19:52:38 Yep, MINIAL=1 fails but the require fixes things.
3 ; Single threaded so that the dumps used for checking happen in order
4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 --verbose=loop \
5 ; RUN: --threads=0 | FileCheck %s
6
Jim Stichnoth 2015/09/01 22:17:38 I'd like to see at least one test with loops and p
ascull 2015/09/03 19:52:38 Does the early exit satisfy this need? All test a
7 define void @test_single_loop(i1 %a) {
jvoung (off chromium) 2015/09/01 18:56:18 Hmm, technically PNaCl does not allow i1 parameter
ascull 2015/09/03 19:52:38 Done.
8 entry:
9 br label %loop0
10
11 loop0: ; <-+
12 br label %loop1 ; |
13 loop1: ; |
14 br i1 %a, label %loop0, label %out ; --+
15
16 out:
17 ret void
18 }
19
jvoung (off chromium) 2015/09/01 18:56:18 Can you still CHECK-LABEL: test_single_loop to he
ascull 2015/09/03 19:52:38 Done.
20 ; CHECK: After loop nest depth analysis
21 ; CHECK-NEXT: LoopNestDepth = 0
22 ; CHECK-NEXT: LoopNestDepth = 1
23 ; CHECK-NEXT: LoopNestDepth = 1
24 ; CHECK-NEXT: LoopNestDepth = 0
25
jvoung (off chromium) 2015/09/01 18:56:18 Could add a "negative" test -- some non-loopy code
ascull 2015/09/03 19:52:38 Done.
26 define void @test_single_loop_with_continue(i1 %a, i1 %b) {
27 entry:
28 br label %loop0
29
30 loop0: ; <-+
31 br label %loop1 ; |
32 loop1: ; |
33 br i1 %a, label %loop0, label %loop2 ; --+
34 loop2: ; |
35 br i1 %b, label %loop0, label %out ; --+
36
37 out:
38 ret void
39 }
40
41 ; CHECK: After loop nest depth analysis
42 ; CHECK-NEXT: LoopNestDepth = 0
43 ; CHECK-NEXT: LoopNestDepth = 1
44 ; CHECK-NEXT: LoopNestDepth = 1
45 ; CHECK-NEXT: LoopNestDepth = 1
46 ; CHECK-NEXT: LoopNestDepth = 0
47
48 define void @test_two_nested_loops(i1 %a, i1 %b) {
49 entry:
50 br label %loop0_0
51
52 loop0_0: ; <---+
53 br label %loop1_0 ; |
54 loop1_0: ; <-+ |
55 br label %loop1_1 ; | |
56 loop1_1: ; | |
57 br i1 %a, label %loop1_0, label %loop0_1 ; --+ |
58 loop0_1: ; |
59 br i1 %b, label %loop0_0, label %out ; ----+
60
61 out:
62 ret void
63 }
64
65 ; CHECK: After loop nest depth analysis
66 ; CHECK-NEXT: LoopNestDepth = 0
67 ; CHECK-NEXT: LoopNestDepth = 1
68 ; CHECK-NEXT: LoopNestDepth = 2
69 ; CHECK-NEXT: LoopNestDepth = 2
70 ; CHECK-NEXT: LoopNestDepth = 1
71 ; CHECK-NEXT: LoopNestDepth = 0
72
73 define void @test_two_nested_loops_with_continue(i1 %a, i1 %b, i1 %c) {
74 entry:
75 br label %loop0_0
76
77 loop0_0: ; <---+
78 br label %loop1_0 ; |
79 loop1_0: ; <-+ |
80 br label %loop1_1 ; | |
81 loop1_1: ; | |
82 br i1 %a, label %loop1_0, label %loop1_2 ; --+ |
83 loop1_2: ; | |
84 br i1 %a, label %loop1_0, label %loop0_1 ; --+ |
85 loop0_1: ; |
86 br i1 %b, label %loop0_0, label %out ; ----+
87
88 out:
89 ret void
90 }
91
92 ; CHECK: After loop nest depth analysis
93 ; CHECK-NEXT: LoopNestDepth = 0
94 ; CHECK-NEXT: LoopNestDepth = 1
95 ; CHECK-NEXT: LoopNestDepth = 2
96 ; CHECK-NEXT: LoopNestDepth = 2
97 ; CHECK-NEXT: LoopNestDepth = 2
98 ; CHECK-NEXT: LoopNestDepth = 1
99 ; CHECK-NEXT: LoopNestDepth = 0
100
101 define void @test_multiple_nested_loops(i1 %a, i1 %b) {
102 entry:
103 br label %loop0_0
104
105 loop0_0: ; <---+
106 br label %loop1_0 ; |
107 loop1_0: ; <-+ |
108 br label %loop1_1 ; | |
109 loop1_1: ; | |
110 br i1 %a, label %loop1_0, label %loop0_1 ; --+ |
111 loop0_1: ; |
112 br label %loop2_0 ; |
113 loop2_0: ; <-+ |
114 br label %loop2_1 ; | |
115 loop2_1: ; | |
116 br i1 %a, label %loop2_0, label %loop0_2 ; --+ |
117 loop0_2: ; |
118 br i1 %b, label %loop0_0, label %out ; ----+
119
120 out:
121 ret void
122 }
123
124 ; CHECK: After loop nest depth analysis
125 ; CHECK-NEXT: LoopNestDepth = 0
126 ; CHECK-NEXT: LoopNestDepth = 1
127 ; CHECK-NEXT: LoopNestDepth = 2
128 ; CHECK-NEXT: LoopNestDepth = 2
129 ; CHECK-NEXT: LoopNestDepth = 1
130 ; CHECK-NEXT: LoopNestDepth = 2
131 ; CHECK-NEXT: LoopNestDepth = 2
132 ; CHECK-NEXT: LoopNestDepth = 1
133 ; CHECK-NEXT: LoopNestDepth = 0
134
135 define void @test_three_nested_loops(i1 %a, i1 %b, i1 %c) {
136 entry:
137 br label %loop0_0
138
139 loop0_0: ; <-----+
140 br label %loop1_0 ; |
141 loop1_0: ; <---+ |
142 br label %loop2_0 ; | |
143 loop2_0: ; <-+ | |
144 br label %loop2_1 ; | | |
145 loop2_1: ; | | |
146 br i1 %a, label %loop2_0, label %loop1_1 ; --+ | |
147 loop1_1: ; | |
148 br i1 %b, label %loop1_0, label %loop0_1 ; ----+ |
149 loop0_1: ; |
150 br i1 %c, label %loop0_0, label %out ; ------+
151
152 out:
153 ret void
154 }
155
156 ; CHECK: After loop nest depth analysis
157 ; CHECK-NEXT: LoopNestDepth = 0
158 ; CHECK-NEXT: LoopNestDepth = 1
159 ; CHECK-NEXT: LoopNestDepth = 2
160 ; CHECK-NEXT: LoopNestDepth = 3
161 ; CHECK-NEXT: LoopNestDepth = 3
162 ; CHECK-NEXT: LoopNestDepth = 2
163 ; CHECK-NEXT: LoopNestDepth = 1
164 ; CHECK-NEXT: LoopNestDepth = 0
OLDNEW
« src/IceTargetLoweringX86BaseImpl.h ('K') | « src/IceTargetLoweringX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698