Lines Matching refs:DT

28     function_ref<void(Function &F, DominatorTree *DT, PostDominatorTree *PDT)>  in runWithDomTree()  argument
33 DominatorTree DT(*F); in runWithDomTree() local
35 Test(*F, &DT, &PDT); in runWithDomTree()
63 [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
72 EXPECT_TRUE(DT->dominates(PhiA, PhiB)); in TEST()
73 EXPECT_TRUE(DT->dominates(PhiB, PhiA)); in TEST()
107 *M, "f", [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
135 EXPECT_TRUE(DT->isReachableFromEntry(BB0)); in TEST()
136 EXPECT_TRUE(DT->isReachableFromEntry(BB1)); in TEST()
137 EXPECT_TRUE(DT->isReachableFromEntry(BB2)); in TEST()
138 EXPECT_FALSE(DT->isReachableFromEntry(BB3)); in TEST()
139 EXPECT_TRUE(DT->isReachableFromEntry(BB4)); in TEST()
142 EXPECT_TRUE(DT->dominates(BB0, BB0)); in TEST()
143 EXPECT_TRUE(DT->dominates(BB0, BB1)); in TEST()
144 EXPECT_TRUE(DT->dominates(BB0, BB2)); in TEST()
145 EXPECT_TRUE(DT->dominates(BB0, BB3)); in TEST()
146 EXPECT_TRUE(DT->dominates(BB0, BB4)); in TEST()
148 EXPECT_FALSE(DT->dominates(BB1, BB0)); in TEST()
149 EXPECT_TRUE(DT->dominates(BB1, BB1)); in TEST()
150 EXPECT_FALSE(DT->dominates(BB1, BB2)); in TEST()
151 EXPECT_TRUE(DT->dominates(BB1, BB3)); in TEST()
152 EXPECT_FALSE(DT->dominates(BB1, BB4)); in TEST()
154 EXPECT_FALSE(DT->dominates(BB2, BB0)); in TEST()
155 EXPECT_FALSE(DT->dominates(BB2, BB1)); in TEST()
156 EXPECT_TRUE(DT->dominates(BB2, BB2)); in TEST()
157 EXPECT_TRUE(DT->dominates(BB2, BB3)); in TEST()
158 EXPECT_FALSE(DT->dominates(BB2, BB4)); in TEST()
160 EXPECT_FALSE(DT->dominates(BB3, BB0)); in TEST()
161 EXPECT_FALSE(DT->dominates(BB3, BB1)); in TEST()
162 EXPECT_FALSE(DT->dominates(BB3, BB2)); in TEST()
163 EXPECT_TRUE(DT->dominates(BB3, BB3)); in TEST()
164 EXPECT_FALSE(DT->dominates(BB3, BB4)); in TEST()
167 EXPECT_FALSE(DT->properlyDominates(BB0, BB0)); in TEST()
168 EXPECT_TRUE(DT->properlyDominates(BB0, BB1)); in TEST()
169 EXPECT_TRUE(DT->properlyDominates(BB0, BB2)); in TEST()
170 EXPECT_TRUE(DT->properlyDominates(BB0, BB3)); in TEST()
172 EXPECT_FALSE(DT->properlyDominates(BB1, BB0)); in TEST()
173 EXPECT_FALSE(DT->properlyDominates(BB1, BB1)); in TEST()
174 EXPECT_FALSE(DT->properlyDominates(BB1, BB2)); in TEST()
175 EXPECT_TRUE(DT->properlyDominates(BB1, BB3)); in TEST()
177 EXPECT_FALSE(DT->properlyDominates(BB2, BB0)); in TEST()
178 EXPECT_FALSE(DT->properlyDominates(BB2, BB1)); in TEST()
179 EXPECT_FALSE(DT->properlyDominates(BB2, BB2)); in TEST()
180 EXPECT_TRUE(DT->properlyDominates(BB2, BB3)); in TEST()
182 EXPECT_FALSE(DT->properlyDominates(BB3, BB0)); in TEST()
183 EXPECT_FALSE(DT->properlyDominates(BB3, BB1)); in TEST()
184 EXPECT_FALSE(DT->properlyDominates(BB3, BB2)); in TEST()
185 EXPECT_FALSE(DT->properlyDominates(BB3, BB3)); in TEST()
188 EXPECT_FALSE(DT->dominates(Y1, Y1)); in TEST()
189 EXPECT_TRUE(DT->dominates(Y1, Y2)); in TEST()
190 EXPECT_FALSE(DT->dominates(Y2, Y1)); in TEST()
191 EXPECT_FALSE(DT->dominates(Y2, Y2)); in TEST()
194 EXPECT_TRUE(DT->dominates(Y6, Y6)); in TEST()
195 EXPECT_TRUE(DT->dominates(Y6, Y7)); in TEST()
196 EXPECT_TRUE(DT->dominates(Y7, Y6)); in TEST()
197 EXPECT_TRUE(DT->dominates(Y7, Y7)); in TEST()
200 EXPECT_TRUE(DT->dominates(Y3, Y4)); in TEST()
201 EXPECT_FALSE(DT->dominates(Y3, Y5)); in TEST()
204 EXPECT_TRUE(DT->dominates(Y2, Y9)); in TEST()
205 EXPECT_FALSE(DT->dominates(Y3, Y9)); in TEST()
206 EXPECT_FALSE(DT->dominates(Y8, Y9)); in TEST()
209 EXPECT_TRUE(DT->dominates(Y1, Y6)); in TEST()
210 EXPECT_TRUE(DT->dominates(Y3, Y6)); in TEST()
213 EXPECT_FALSE(DT->dominates(Y6, Y1)); in TEST()
216 EXPECT_FALSE(DT->dominates(Y1, BB0)); in TEST()
217 EXPECT_TRUE(DT->dominates(Y1, BB1)); in TEST()
218 EXPECT_TRUE(DT->dominates(Y1, BB2)); in TEST()
219 EXPECT_TRUE(DT->dominates(Y1, BB3)); in TEST()
220 EXPECT_TRUE(DT->dominates(Y1, BB4)); in TEST()
222 EXPECT_FALSE(DT->dominates(Y3, BB0)); in TEST()
223 EXPECT_TRUE(DT->dominates(Y3, BB1)); in TEST()
224 EXPECT_FALSE(DT->dominates(Y3, BB2)); in TEST()
225 EXPECT_TRUE(DT->dominates(Y3, BB3)); in TEST()
226 EXPECT_FALSE(DT->dominates(Y3, BB4)); in TEST()
228 EXPECT_TRUE(DT->dominates(Y6, BB3)); in TEST()
240 DT->getDescendants(BB0, DominatedBBs); in TEST()
248 DT->getDescendants(BB3, DominatedBBs); in TEST()
249 DT->getDescendants(BB3, PostDominatedBBs); in TEST()
254 DT->updateDFSNumbers(); in TEST()
255 EXPECT_EQ(DT->getNode(BB0)->getDFSNumIn(), 0UL); in TEST()
256 EXPECT_EQ(DT->getNode(BB0)->getDFSNumOut(), 7UL); in TEST()
257 EXPECT_EQ(DT->getNode(BB1)->getDFSNumIn(), 1UL); in TEST()
258 EXPECT_EQ(DT->getNode(BB1)->getDFSNumOut(), 2UL); in TEST()
259 EXPECT_EQ(DT->getNode(BB2)->getDFSNumIn(), 5UL); in TEST()
260 EXPECT_EQ(DT->getNode(BB2)->getDFSNumOut(), 6UL); in TEST()
261 EXPECT_EQ(DT->getNode(BB4)->getDFSNumIn(), 3UL); in TEST()
262 EXPECT_EQ(DT->getNode(BB4)->getDFSNumOut(), 4UL); in TEST()
265 EXPECT_EQ(DT->getNode(BB0)->getLevel(), 0U); in TEST()
266 EXPECT_EQ(DT->getNode(BB1)->getLevel(), 1U); in TEST()
267 EXPECT_EQ(DT->getNode(BB2)->getLevel(), 1U); in TEST()
268 EXPECT_EQ(DT->getNode(BB4)->getLevel(), 1U); in TEST()
273 DT->recalculate(F); in TEST()
276 DT->updateDFSNumbers(); in TEST()
277 EXPECT_EQ(DT->getNode(BB0)->getDFSNumIn(), 0UL); in TEST()
278 EXPECT_EQ(DT->getNode(BB0)->getDFSNumOut(), 9UL); in TEST()
279 EXPECT_EQ(DT->getNode(BB1)->getDFSNumIn(), 1UL); in TEST()
280 EXPECT_EQ(DT->getNode(BB1)->getDFSNumOut(), 4UL); in TEST()
281 EXPECT_EQ(DT->getNode(BB2)->getDFSNumIn(), 7UL); in TEST()
282 EXPECT_EQ(DT->getNode(BB2)->getDFSNumOut(), 8UL); in TEST()
283 EXPECT_EQ(DT->getNode(BB3)->getDFSNumIn(), 2UL); in TEST()
284 EXPECT_EQ(DT->getNode(BB3)->getDFSNumOut(), 3UL); in TEST()
285 EXPECT_EQ(DT->getNode(BB4)->getDFSNumIn(), 5UL); in TEST()
286 EXPECT_EQ(DT->getNode(BB4)->getDFSNumOut(), 6UL); in TEST()
289 EXPECT_EQ(DT->getNode(BB0)->getLevel(), 0U); in TEST()
290 EXPECT_EQ(DT->getNode(BB1)->getLevel(), 1U); in TEST()
291 EXPECT_EQ(DT->getNode(BB2)->getLevel(), 1U); in TEST()
292 EXPECT_EQ(DT->getNode(BB3)->getLevel(), 2U); in TEST()
293 EXPECT_EQ(DT->getNode(BB4)->getLevel(), 1U); in TEST()
296 EXPECT_TRUE(DT->verify()); in TEST()
302 DT->setNewRoot(NewEntry); in TEST()
303 EXPECT_TRUE(DT->verify()); in TEST()
327 *M, "f", [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
347 EXPECT_TRUE(DT->dominates(Edge_BB0_BB2, BB2)); in TEST()
348 EXPECT_FALSE(DT->dominates(Edge_BB0_BB2, BB1)); in TEST()
350 EXPECT_FALSE(DT->dominates(Edge_BB0_BB1_a, BB1)); in TEST()
351 EXPECT_FALSE(DT->dominates(Edge_BB0_BB1_b, BB1)); in TEST()
353 EXPECT_FALSE(DT->dominates(Edge_BB0_BB1_a, BB2)); in TEST()
354 EXPECT_FALSE(DT->dominates(Edge_BB0_BB1_b, BB2)); in TEST()
411 *M, "f", [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
420 EXPECT_TRUE(DT->verify()); in TEST()
426 DT->deleteEdge(C, B); in TEST()
429 EXPECT_TRUE(DT->verify()); in TEST()
436 EXPECT_EQ(DT->compare(NDT), 0); in TEST()
505 *M, "f", [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
514 EXPECT_TRUE(DT->verify()); in TEST()
519 DT->deleteEdge(C, B); in TEST()
520 EXPECT_TRUE(DT->verify()); in TEST()
528 EXPECT_EQ(DT->compare(NDT), 0); in TEST()
594 *M, "f", [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
603 EXPECT_TRUE(DT->verify()); in TEST()
608 DT->deleteEdge(C, C2); in TEST()
612 EXPECT_EQ(DT->getNode(C2), nullptr); in TEST()
616 EXPECT_TRUE(DT->verify()); in TEST()
623 EXPECT_EQ(DT->compare(NDT), 0); in TEST()
668 *M, "f", [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
678 DT->updateDFSNumbers(); in TEST()
679 ForwardIDFCalculator IDF(*DT); in TEST()
691 EXPECT_EQ(DT->getNode(A)->getDFSNumIn(), 0UL); in TEST()
694 EXPECT_TRUE(DT->getNode(IDFBlocks[0])->getDFSNumIn() < in TEST()
695 DT->getNode(IDFBlocks[1])->getDFSNumIn()); in TEST()
720 DominatorTree DT(*Holder.F); in TEST() local
721 EXPECT_TRUE(DT.verify()); in TEST()
730 DT.insertEdge(From, To); in TEST()
731 EXPECT_TRUE(DT.verify()); in TEST()
746 DominatorTree DT(*Holder.F); in TEST() local
747 EXPECT_TRUE(DT.verify()); in TEST()
757 DT.insertEdge(From, To); in TEST()
758 EXPECT_TRUE(DT.verify()); in TEST()
774 DominatorTree DT(*Holder.F); in TEST() local
775 EXPECT_TRUE(DT.verify()); in TEST()
784 DT.insertEdge(From, To); in TEST()
785 EXPECT_TRUE(DT.verify()); in TEST()
825 DominatorTree DT(*Holder.F); in TEST() local
826 EXPECT_TRUE(DT.verify()); in TEST()
835 DT.insertEdge(From, To); in TEST()
836 EXPECT_TRUE(DT.verify()); in TEST()
855 DominatorTree DT(*Holder.F); in TEST() local
856 EXPECT_TRUE(DT.verify()); in TEST()
865 DT.insertEdge(From, To); in TEST()
866 EXPECT_TRUE(DT.verify()); in TEST()
882 DominatorTree DT(*Holder.F); in TEST() local
883 EXPECT_TRUE(DT.verify()); in TEST()
892 DT.deleteEdge(From, To); in TEST()
893 EXPECT_TRUE(DT.verify()); in TEST()
908 DominatorTree DT(*Holder.F); in TEST() local
909 EXPECT_TRUE(DT.verify()); in TEST()
918 DT.deleteEdge(From, To); in TEST()
919 EXPECT_TRUE(DT.verify()); in TEST()
938 DominatorTree DT(*Holder.F); in TEST() local
939 EXPECT_TRUE(DT.verify()); in TEST()
948 DT.insertEdge(From, To); in TEST()
951 DT.deleteEdge(From, To); in TEST()
955 EXPECT_TRUE(DT.verify()); in TEST()
976 DominatorTree DT(*Holder.F); in TEST() local
977 EXPECT_TRUE(DT.verify()); in TEST()
986 DT.insertEdge(From, To); in TEST()
989 DT.deleteEdge(From, To); in TEST()
993 EXPECT_TRUE(DT.verify()); in TEST()
1012 DominatorTree DT(*Holder.F); in TEST() local
1013 EXPECT_TRUE(DT.verify()); in TEST()
1018 DT.insertEdge(From, To); in TEST()
1020 EXPECT_TRUE(DT.verify()); in TEST()
1040 [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
1053 EXPECT_TRUE(DT->dominates(E01, E01)); in TEST()
1054 EXPECT_FALSE(DT->dominates(E01, E02)); in TEST()
1055 EXPECT_TRUE(DT->dominates(E01, E13)); in TEST()
1056 EXPECT_FALSE(DT->dominates(E01, E23)); in TEST()
1058 EXPECT_FALSE(DT->dominates(E02, E01)); in TEST()
1059 EXPECT_TRUE(DT->dominates(E02, E02)); in TEST()
1060 EXPECT_FALSE(DT->dominates(E02, E13)); in TEST()
1061 EXPECT_TRUE(DT->dominates(E02, E23)); in TEST()
1063 EXPECT_FALSE(DT->dominates(E13, E01)); in TEST()
1064 EXPECT_FALSE(DT->dominates(E13, E02)); in TEST()
1065 EXPECT_TRUE(DT->dominates(E13, E13)); in TEST()
1066 EXPECT_FALSE(DT->dominates(E13, E23)); in TEST()
1068 EXPECT_FALSE(DT->dominates(E23, E01)); in TEST()
1069 EXPECT_FALSE(DT->dominates(E23, E02)); in TEST()
1070 EXPECT_FALSE(DT->dominates(E23, E13)); in TEST()
1071 EXPECT_TRUE(DT->dominates(E23, E23)); in TEST()
1087 [&](Function &F, DominatorTree *DT, PostDominatorTree *PDT) { in TEST() argument
1093 EXPECT_TRUE(DT->dominates(A, I)); in TEST()
1094 EXPECT_TRUE(DT->dominates(G, I)); in TEST()
1095 EXPECT_TRUE(DT->dominates(C, I)); in TEST()
1098 EXPECT_TRUE(DT->dominates(A, U)); in TEST()
1099 EXPECT_TRUE(DT->dominates(G, U)); in TEST()
1100 EXPECT_TRUE(DT->dominates(C, U)); in TEST()