blob: 9697f1f99a2887340e85c4b4d6f9c571b04b23b9 [file] [log] [blame]
Chris Lattner17152292001-07-02 05:46:38 +00001//===- DominatorSet.cpp - Dominator Set Calculation --------------*- C++ -*--=//
2//
Chris Lattner2fbfdcf2002-04-07 20:49:59 +00003// This file provides a simple class to calculate the dominator set of a
4// function.
Chris Lattner17152292001-07-02 05:46:38 +00005//
6//===----------------------------------------------------------------------===//
7
8#include "llvm/Analysis/Dominators.h"
Chris Lattner483e14e2002-04-27 07:27:19 +00009#include "llvm/Transforms/UnifyFunctionExitNodes.h"
Chris Lattner221d6882002-02-12 21:07:25 +000010#include "llvm/Support/CFG.h"
Chris Lattnercee8f9a2001-11-27 00:03:19 +000011#include "Support/DepthFirstIterator.h"
12#include "Support/STLExtras.h"
Chris Lattnereb5230c2002-02-05 03:35:31 +000013#include "Support/SetOperations.h"
Chris Lattner17152292001-07-02 05:46:38 +000014#include <algorithm>
Chris Lattner697954c2002-01-20 22:54:45 +000015using std::set;
16
Chris Lattner94108ab2001-07-06 16:58:22 +000017//===----------------------------------------------------------------------===//
Chris Lattner17152292001-07-02 05:46:38 +000018// DominatorSet Implementation
19//===----------------------------------------------------------------------===//
20
Chris Lattner07a228d2002-05-06 19:32:07 +000021AnalysisID DominatorSet::ID(AnalysisID::create<DominatorSet>(), true);
22AnalysisID DominatorSet::PostDomID(AnalysisID::create<DominatorSet>(), true);
Chris Lattner93193f82002-01-31 00:42:27 +000023
Chris Lattner1b7f7dc2002-04-28 16:21:30 +000024bool DominatorSet::runOnFunction(Function *F) {
Chris Lattner93193f82002-01-31 00:42:27 +000025 Doms.clear(); // Reset from the last time we were run...
26
27 if (isPostDominator())
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000028 calcPostDominatorSet(F);
Chris Lattner93193f82002-01-31 00:42:27 +000029 else
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000030 calcForwardDominatorSet(F);
Chris Lattner93193f82002-01-31 00:42:27 +000031 return false;
Chris Lattner94108ab2001-07-06 16:58:22 +000032}
33
Chris Lattner93193f82002-01-31 00:42:27 +000034
Chris Lattner94108ab2001-07-06 16:58:22 +000035// calcForwardDominatorSet - This method calculates the forward dominator sets
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000036// for the specified function.
Chris Lattner94108ab2001-07-06 16:58:22 +000037//
Chris Lattner1b7f7dc2002-04-28 16:21:30 +000038void DominatorSet::calcForwardDominatorSet(Function *M) {
Chris Lattner93193f82002-01-31 00:42:27 +000039 Root = M->getEntryNode();
Chris Lattner455889a2002-02-12 22:39:50 +000040 assert(pred_begin(Root) == pred_end(Root) &&
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000041 "Root node has predecessors in function!");
Chris Lattnerff5a8c42001-11-26 18:52:02 +000042
Chris Lattner17152292001-07-02 05:46:38 +000043 bool Changed;
44 do {
45 Changed = false;
46
47 DomSetType WorkingSet;
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000048 df_iterator<Function*> It = df_begin(M), End = df_end(M);
Chris Lattner17152292001-07-02 05:46:38 +000049 for ( ; It != End; ++It) {
Chris Lattnera298d272002-04-28 00:15:57 +000050 BasicBlock *BB = *It;
51 pred_iterator PI = pred_begin(BB), PEnd = pred_end(BB);
Chris Lattner17152292001-07-02 05:46:38 +000052 if (PI != PEnd) { // Is there SOME predecessor?
53 // Loop until we get to a predecessor that has had it's dom set filled
54 // in at least once. We are guaranteed to have this because we are
55 // traversing the graph in DFO and have handled start nodes specially.
56 //
57 while (Doms[*PI].size() == 0) ++PI;
58 WorkingSet = Doms[*PI];
59
60 for (++PI; PI != PEnd; ++PI) { // Intersect all of the predecessor sets
61 DomSetType &PredSet = Doms[*PI];
62 if (PredSet.size())
63 set_intersect(WorkingSet, PredSet);
64 }
65 }
66
67 WorkingSet.insert(BB); // A block always dominates itself
68 DomSetType &BBSet = Doms[BB];
69 if (BBSet != WorkingSet) {
70 BBSet.swap(WorkingSet); // Constant time operation!
71 Changed = true; // The sets changed.
72 }
73 WorkingSet.clear(); // Clear out the set for next iteration
74 }
75 } while (Changed);
Chris Lattner94108ab2001-07-06 16:58:22 +000076}
Chris Lattner17152292001-07-02 05:46:38 +000077
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000078// Postdominator set constructor. This ctor converts the specified function to
Chris Lattner94108ab2001-07-06 16:58:22 +000079// only have a single exit node (return stmt), then calculates the post
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000080// dominance sets for the function.
Chris Lattner94108ab2001-07-06 16:58:22 +000081//
Chris Lattner1b7f7dc2002-04-28 16:21:30 +000082void DominatorSet::calcPostDominatorSet(Function *F) {
Chris Lattner93193f82002-01-31 00:42:27 +000083 // Since we require that the unify all exit nodes pass has been run, we know
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000084 // that there can be at most one return instruction in the function left.
Chris Lattner93193f82002-01-31 00:42:27 +000085 // Get it.
86 //
Chris Lattner483e14e2002-04-27 07:27:19 +000087 Root = getAnalysis<UnifyFunctionExitNodes>().getExitNode();
Chris Lattner94108ab2001-07-06 16:58:22 +000088
Chris Lattner2fbfdcf2002-04-07 20:49:59 +000089 if (Root == 0) { // No exit node for the function? Postdomsets are all empty
Chris Lattnera298d272002-04-28 00:15:57 +000090 for (Function::iterator FI = F->begin(), FE = F->end(); FI != FE; ++FI)
91 Doms[*FI] = DomSetType();
Chris Lattner384e5b12001-08-23 17:07:19 +000092 return;
93 }
Chris Lattner94108ab2001-07-06 16:58:22 +000094
95 bool Changed;
96 do {
97 Changed = false;
98
99 set<const BasicBlock*> Visited;
100 DomSetType WorkingSet;
Chris Lattner93193f82002-01-31 00:42:27 +0000101 idf_iterator<BasicBlock*> It = idf_begin(Root), End = idf_end(Root);
Chris Lattner94108ab2001-07-06 16:58:22 +0000102 for ( ; It != End; ++It) {
Chris Lattnera298d272002-04-28 00:15:57 +0000103 BasicBlock *BB = *It;
104 succ_iterator PI = succ_begin(BB), PEnd = succ_end(BB);
Chris Lattner94108ab2001-07-06 16:58:22 +0000105 if (PI != PEnd) { // Is there SOME predecessor?
106 // Loop until we get to a successor that has had it's dom set filled
107 // in at least once. We are guaranteed to have this because we are
108 // traversing the graph in DFO and have handled start nodes specially.
109 //
110 while (Doms[*PI].size() == 0) ++PI;
111 WorkingSet = Doms[*PI];
112
113 for (++PI; PI != PEnd; ++PI) { // Intersect all of the successor sets
114 DomSetType &PredSet = Doms[*PI];
115 if (PredSet.size())
116 set_intersect(WorkingSet, PredSet);
117 }
118 }
119
120 WorkingSet.insert(BB); // A block always dominates itself
121 DomSetType &BBSet = Doms[BB];
122 if (BBSet != WorkingSet) {
123 BBSet.swap(WorkingSet); // Constant time operation!
124 Changed = true; // The sets changed.
125 }
126 WorkingSet.clear(); // Clear out the set for next iteration
127 }
128 } while (Changed);
Chris Lattner17152292001-07-02 05:46:38 +0000129}
130
Chris Lattnerf57b8452002-04-27 06:56:12 +0000131// getAnalysisUsage - This obviously provides a dominator set, but it also
132// uses the UnifyFunctionExitNodes pass if building post-dominators
Chris Lattner93193f82002-01-31 00:42:27 +0000133//
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000134void DominatorSet::getAnalysisUsage(AnalysisUsage &AU) const {
Chris Lattnerf57b8452002-04-27 06:56:12 +0000135 AU.setPreservesAll();
Chris Lattner65b97092002-01-31 18:29:24 +0000136 if (isPostDominator()) {
Chris Lattnerf57b8452002-04-27 06:56:12 +0000137 AU.addProvided(PostDomID);
Chris Lattner483e14e2002-04-27 07:27:19 +0000138 AU.addRequired(UnifyFunctionExitNodes::ID);
Chris Lattner65b97092002-01-31 18:29:24 +0000139 } else {
Chris Lattnerf57b8452002-04-27 06:56:12 +0000140 AU.addProvided(ID);
Chris Lattner65b97092002-01-31 18:29:24 +0000141 }
Chris Lattner93193f82002-01-31 00:42:27 +0000142}
143
Chris Lattner17152292001-07-02 05:46:38 +0000144
145//===----------------------------------------------------------------------===//
146// ImmediateDominators Implementation
147//===----------------------------------------------------------------------===//
148
Chris Lattner07a228d2002-05-06 19:32:07 +0000149AnalysisID ImmediateDominators::ID(AnalysisID::create<ImmediateDominators>(), true);
150AnalysisID ImmediateDominators::PostDomID(AnalysisID::create<ImmediateDominators>(), true);
Chris Lattner93193f82002-01-31 00:42:27 +0000151
Chris Lattner17152292001-07-02 05:46:38 +0000152// calcIDoms - Calculate the immediate dominator mapping, given a set of
153// dominators for every basic block.
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000154void ImmediateDominators::calcIDoms(const DominatorSet &DS) {
Chris Lattner17152292001-07-02 05:46:38 +0000155 // Loop over all of the nodes that have dominators... figuring out the IDOM
156 // for each node...
157 //
158 for (DominatorSet::const_iterator DI = DS.begin(), DEnd = DS.end();
159 DI != DEnd; ++DI) {
Chris Lattnera298d272002-04-28 00:15:57 +0000160 BasicBlock *BB = DI->first;
Chris Lattner17152292001-07-02 05:46:38 +0000161 const DominatorSet::DomSetType &Dominators = DI->second;
162 unsigned DomSetSize = Dominators.size();
163 if (DomSetSize == 1) continue; // Root node... IDom = null
164
165 // Loop over all dominators of this node. This corresponds to looping over
166 // nodes in the dominator chain, looking for a node whose dominator set is
167 // equal to the current nodes, except that the current node does not exist
168 // in it. This means that it is one level higher in the dom chain than the
169 // current node, and it is our idom!
170 //
171 DominatorSet::DomSetType::const_iterator I = Dominators.begin();
172 DominatorSet::DomSetType::const_iterator End = Dominators.end();
173 for (; I != End; ++I) { // Iterate over dominators...
174 // All of our dominators should form a chain, where the number of elements
175 // in the dominator set indicates what level the node is at in the chain.
176 // We want the node immediately above us, so it will have an identical
177 // dominator set, except that BB will not dominate it... therefore it's
178 // dominator set size will be one less than BB's...
179 //
180 if (DS.getDominators(*I).size() == DomSetSize - 1) {
181 IDoms[BB] = *I;
182 break;
183 }
184 }
185 }
186}
187
188
189//===----------------------------------------------------------------------===//
190// DominatorTree Implementation
191//===----------------------------------------------------------------------===//
192
Chris Lattner07a228d2002-05-06 19:32:07 +0000193AnalysisID DominatorTree::ID(AnalysisID::create<DominatorTree>(), true);
194AnalysisID DominatorTree::PostDomID(AnalysisID::create<DominatorTree>(), true);
Chris Lattner93193f82002-01-31 00:42:27 +0000195
196// DominatorTree::reset - Free all of the tree node memory.
Chris Lattner17152292001-07-02 05:46:38 +0000197//
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000198void DominatorTree::reset() {
Chris Lattner17152292001-07-02 05:46:38 +0000199 for (NodeMapType::iterator I = Nodes.begin(), E = Nodes.end(); I != E; ++I)
200 delete I->second;
Chris Lattner93193f82002-01-31 00:42:27 +0000201 Nodes.clear();
Chris Lattner17152292001-07-02 05:46:38 +0000202}
203
204
Chris Lattner93193f82002-01-31 00:42:27 +0000205#if 0
206// Given immediate dominators, we can also calculate the dominator tree
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000207DominatorTree::DominatorTree(const ImmediateDominators &IDoms)
Chris Lattner94108ab2001-07-06 16:58:22 +0000208 : DominatorBase(IDoms.getRoot()) {
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000209 const Function *M = Root->getParent();
Chris Lattner17152292001-07-02 05:46:38 +0000210
211 Nodes[Root] = new Node(Root, 0); // Add a node for the root...
212
213 // Iterate over all nodes in depth first order...
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000214 for (df_iterator<const Function*> I = df_begin(M), E = df_end(M); I!=E; ++I) {
Chris Lattner17152292001-07-02 05:46:38 +0000215 const BasicBlock *BB = *I, *IDom = IDoms[*I];
216
217 if (IDom != 0) { // Ignore the root node and other nasty nodes
218 // We know that the immediate dominator should already have a node,
219 // because we are traversing the CFG in depth first order!
220 //
221 assert(Nodes[IDom] && "No node for IDOM?");
222 Node *IDomNode = Nodes[IDom];
223
224 // Add a new tree node for this BasicBlock, and link it as a child of
225 // IDomNode
226 Nodes[BB] = IDomNode->addChild(new Node(BB, IDomNode));
227 }
228 }
229}
Chris Lattner93193f82002-01-31 00:42:27 +0000230#endif
Chris Lattner17152292001-07-02 05:46:38 +0000231
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000232void DominatorTree::calculate(const DominatorSet &DS) {
Chris Lattner17152292001-07-02 05:46:38 +0000233 Nodes[Root] = new Node(Root, 0); // Add a node for the root...
234
Chris Lattner94108ab2001-07-06 16:58:22 +0000235 if (!isPostDominator()) {
236 // Iterate over all nodes in depth first order...
Chris Lattner93193f82002-01-31 00:42:27 +0000237 for (df_iterator<BasicBlock*> I = df_begin(Root), E = df_end(Root);
Chris Lattner3ff43872001-09-28 22:56:31 +0000238 I != E; ++I) {
Chris Lattnera298d272002-04-28 00:15:57 +0000239 BasicBlock *BB = *I;
Chris Lattner94108ab2001-07-06 16:58:22 +0000240 const DominatorSet::DomSetType &Dominators = DS.getDominators(BB);
241 unsigned DomSetSize = Dominators.size();
242 if (DomSetSize == 1) continue; // Root node... IDom = null
243
Chris Lattner3ff43872001-09-28 22:56:31 +0000244 // Loop over all dominators of this node. This corresponds to looping over
Chris Lattner94108ab2001-07-06 16:58:22 +0000245 // nodes in the dominator chain, looking for a node whose dominator set is
246 // equal to the current nodes, except that the current node does not exist
Chris Lattner3ff43872001-09-28 22:56:31 +0000247 // in it. This means that it is one level higher in the dom chain than the
Chris Lattner94108ab2001-07-06 16:58:22 +0000248 // current node, and it is our idom! We know that we have already added
249 // a DominatorTree node for our idom, because the idom must be a
250 // predecessor in the depth first order that we are iterating through the
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000251 // function.
Chris Lattner17152292001-07-02 05:46:38 +0000252 //
Chris Lattner94108ab2001-07-06 16:58:22 +0000253 DominatorSet::DomSetType::const_iterator I = Dominators.begin();
254 DominatorSet::DomSetType::const_iterator End = Dominators.end();
255 for (; I != End; ++I) { // Iterate over dominators...
Chris Lattner3ff43872001-09-28 22:56:31 +0000256 // All of our dominators should form a chain, where the number of
257 // elements in the dominator set indicates what level the node is at in
258 // the chain. We want the node immediately above us, so it will have
259 // an identical dominator set, except that BB will not dominate it...
260 // therefore it's dominator set size will be one less than BB's...
Chris Lattner17152292001-07-02 05:46:38 +0000261 //
Chris Lattner94108ab2001-07-06 16:58:22 +0000262 if (DS.getDominators(*I).size() == DomSetSize - 1) {
263 // We know that the immediate dominator should already have a node,
264 // because we are traversing the CFG in depth first order!
265 //
266 Node *IDomNode = Nodes[*I];
267 assert(IDomNode && "No node for IDOM?");
268
269 // Add a new tree node for this BasicBlock, and link it as a child of
270 // IDomNode
271 Nodes[BB] = IDomNode->addChild(new Node(BB, IDomNode));
272 break;
273 }
274 }
275 }
Chris Lattner384e5b12001-08-23 17:07:19 +0000276 } else if (Root) {
Chris Lattner94108ab2001-07-06 16:58:22 +0000277 // Iterate over all nodes in depth first order...
Chris Lattner93193f82002-01-31 00:42:27 +0000278 for (idf_iterator<BasicBlock*> I = idf_begin(Root), E = idf_end(Root);
Chris Lattner3ff43872001-09-28 22:56:31 +0000279 I != E; ++I) {
Chris Lattnera298d272002-04-28 00:15:57 +0000280 BasicBlock *BB = *I;
Chris Lattner94108ab2001-07-06 16:58:22 +0000281 const DominatorSet::DomSetType &Dominators = DS.getDominators(BB);
282 unsigned DomSetSize = Dominators.size();
283 if (DomSetSize == 1) continue; // Root node... IDom = null
284
Chris Lattner3ff43872001-09-28 22:56:31 +0000285 // Loop over all dominators of this node. This corresponds to looping
286 // over nodes in the dominator chain, looking for a node whose dominator
287 // set is equal to the current nodes, except that the current node does
288 // not exist in it. This means that it is one level higher in the dom
289 // chain than the current node, and it is our idom! We know that we have
290 // already added a DominatorTree node for our idom, because the idom must
291 // be a predecessor in the depth first order that we are iterating through
Chris Lattner2fbfdcf2002-04-07 20:49:59 +0000292 // the function.
Chris Lattner94108ab2001-07-06 16:58:22 +0000293 //
294 DominatorSet::DomSetType::const_iterator I = Dominators.begin();
295 DominatorSet::DomSetType::const_iterator End = Dominators.end();
296 for (; I != End; ++I) { // Iterate over dominators...
Chris Lattner93193f82002-01-31 00:42:27 +0000297 // All of our dominators should form a chain, where the number
298 // of elements in the dominator set indicates what level the
299 // node is at in the chain. We want the node immediately
300 // above us, so it will have an identical dominator set,
301 // except that BB will not dominate it... therefore it's
Chris Lattner94108ab2001-07-06 16:58:22 +0000302 // dominator set size will be one less than BB's...
303 //
304 if (DS.getDominators(*I).size() == DomSetSize - 1) {
305 // We know that the immediate dominator should already have a node,
306 // because we are traversing the CFG in depth first order!
307 //
308 Node *IDomNode = Nodes[*I];
309 assert(IDomNode && "No node for IDOM?");
310
311 // Add a new tree node for this BasicBlock, and link it as a child of
312 // IDomNode
313 Nodes[BB] = IDomNode->addChild(new Node(BB, IDomNode));
314 break;
315 }
Chris Lattner17152292001-07-02 05:46:38 +0000316 }
317 }
318 }
319}
320
321
322
323//===----------------------------------------------------------------------===//
324// DominanceFrontier Implementation
325//===----------------------------------------------------------------------===//
326
Chris Lattner07a228d2002-05-06 19:32:07 +0000327AnalysisID DominanceFrontier::ID(AnalysisID::create<DominanceFrontier>(), true);
328AnalysisID DominanceFrontier::PostDomID(AnalysisID::create<DominanceFrontier>(), true);
Chris Lattner93193f82002-01-31 00:42:27 +0000329
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000330const DominanceFrontier::DomSetType &
331DominanceFrontier::calcDomFrontier(const DominatorTree &DT,
332 const DominatorTree::Node *Node) {
Chris Lattner17152292001-07-02 05:46:38 +0000333 // Loop over CFG successors to calculate DFlocal[Node]
Chris Lattnera298d272002-04-28 00:15:57 +0000334 BasicBlock *BB = Node->getNode();
Chris Lattner17152292001-07-02 05:46:38 +0000335 DomSetType &S = Frontiers[BB]; // The new set to fill in...
336
Chris Lattnera298d272002-04-28 00:15:57 +0000337 for (succ_iterator SI = succ_begin(BB), SE = succ_end(BB);
Chris Lattner455889a2002-02-12 22:39:50 +0000338 SI != SE; ++SI) {
Chris Lattner17152292001-07-02 05:46:38 +0000339 // Does Node immediately dominate this successor?
340 if (DT[*SI]->getIDom() != Node)
341 S.insert(*SI);
342 }
343
344 // At this point, S is DFlocal. Now we union in DFup's of our children...
345 // Loop through and visit the nodes that Node immediately dominates (Node's
346 // children in the IDomTree)
347 //
348 for (DominatorTree::Node::const_iterator NI = Node->begin(), NE = Node->end();
349 NI != NE; ++NI) {
350 DominatorTree::Node *IDominee = *NI;
351 const DomSetType &ChildDF = calcDomFrontier(DT, IDominee);
352
353 DomSetType::const_iterator CDFI = ChildDF.begin(), CDFE = ChildDF.end();
354 for (; CDFI != CDFE; ++CDFI) {
355 if (!Node->dominates(DT[*CDFI]))
356 S.insert(*CDFI);
357 }
358 }
359
360 return S;
361}
Chris Lattner94108ab2001-07-06 16:58:22 +0000362
Chris Lattner1b7f7dc2002-04-28 16:21:30 +0000363const DominanceFrontier::DomSetType &
364DominanceFrontier::calcPostDomFrontier(const DominatorTree &DT,
365 const DominatorTree::Node *Node) {
Chris Lattner94108ab2001-07-06 16:58:22 +0000366 // Loop over CFG successors to calculate DFlocal[Node]
Chris Lattnera298d272002-04-28 00:15:57 +0000367 BasicBlock *BB = Node->getNode();
Chris Lattner94108ab2001-07-06 16:58:22 +0000368 DomSetType &S = Frontiers[BB]; // The new set to fill in...
Chris Lattner384e5b12001-08-23 17:07:19 +0000369 if (!Root) return S;
Chris Lattner94108ab2001-07-06 16:58:22 +0000370
Chris Lattnera298d272002-04-28 00:15:57 +0000371 for (pred_iterator SI = pred_begin(BB), SE = pred_end(BB);
Chris Lattner455889a2002-02-12 22:39:50 +0000372 SI != SE; ++SI) {
Chris Lattner94108ab2001-07-06 16:58:22 +0000373 // Does Node immediately dominate this predeccessor?
374 if (DT[*SI]->getIDom() != Node)
375 S.insert(*SI);
376 }
377
378 // At this point, S is DFlocal. Now we union in DFup's of our children...
379 // Loop through and visit the nodes that Node immediately dominates (Node's
380 // children in the IDomTree)
381 //
382 for (DominatorTree::Node::const_iterator NI = Node->begin(), NE = Node->end();
383 NI != NE; ++NI) {
384 DominatorTree::Node *IDominee = *NI;
Chris Lattner35908302001-07-08 05:54:09 +0000385 const DomSetType &ChildDF = calcPostDomFrontier(DT, IDominee);
Chris Lattner94108ab2001-07-06 16:58:22 +0000386
387 DomSetType::const_iterator CDFI = ChildDF.begin(), CDFE = ChildDF.end();
388 for (; CDFI != CDFE; ++CDFI) {
389 if (!Node->dominates(DT[*CDFI]))
390 S.insert(*CDFI);
391 }
392 }
393
394 return S;
395}