@@ -133,14 +133,7 @@ class SelectInstToUnfold {
133133
134134 explicit operator bool () const { return SI && SIUse; }
135135};
136- } // namespace
137-
138- static void unfold (DomTreeUpdater *DTU, LoopInfo *LI,
139- SelectInstToUnfold SIToUnfold,
140- std::vector<SelectInstToUnfold> *NewSIsToUnfold,
141- std::vector<BasicBlock *> *NewBBs);
142136
143- namespace {
144137class DFAJumpThreading {
145138public:
146139 DFAJumpThreading (AssumptionCache *AC, DominatorTree *DT, LoopInfo *LI,
@@ -169,6 +162,11 @@ class DFAJumpThreading {
169162 }
170163 }
171164
165+ static void unfold (DomTreeUpdater *DTU, LoopInfo *LI,
166+ SelectInstToUnfold SIToUnfold,
167+ std::vector<SelectInstToUnfold> *NewSIsToUnfold,
168+ std::vector<BasicBlock *> *NewBBs);
169+
172170 AssumptionCache *AC;
173171 DominatorTree *DT;
174172 LoopInfo *LI;
@@ -184,10 +182,10 @@ class DFAJumpThreading {
184182// / created basic blocks into \p NewBBs.
185183// /
186184// / TODO: merge it with CodeGenPrepare::optimizeSelectInst() if possible.
187- static void unfold (DomTreeUpdater *DTU, LoopInfo *LI,
188- SelectInstToUnfold SIToUnfold,
189- std::vector<SelectInstToUnfold> *NewSIsToUnfold,
190- std::vector<BasicBlock *> *NewBBs) {
185+ void DFAJumpThreading:: unfold (DomTreeUpdater *DTU, LoopInfo *LI,
186+ SelectInstToUnfold SIToUnfold,
187+ std::vector<SelectInstToUnfold> *NewSIsToUnfold,
188+ std::vector<BasicBlock *> *NewBBs) {
191189 SelectInst *SI = SIToUnfold.getInst ();
192190 PHINode *SIUse = SIToUnfold.getUse ();
193191 assert (SI->hasOneUse ());
@@ -377,11 +375,11 @@ inline raw_ostream &operator<<(raw_ostream &OS, const PathType &Path) {
377375 return OS;
378376}
379377
378+ namespace {
380379// / ThreadingPath is a path in the control flow of a loop that can be threaded
381380// / by cloning necessary basic blocks and replacing conditional branches with
382381// / unconditional ones. A threading path includes a list of basic blocks, the
383382// / exit state, and the block that determines the next state.
384- namespace {
385383struct ThreadingPath {
386384 // / Exit value is DFA's exit state for the given path.
387385 APInt getExitValue () const { return ExitVal; }
0 commit comments