Skip to content

Commit 57c5751

Browse files
committed
Review feedback
1 parent f3101f3 commit 57c5751

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {
144137
class DFAJumpThreading {
145138
public:
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 {
385383
struct ThreadingPath {
386384
/// Exit value is DFA's exit state for the given path.
387385
APInt getExitValue() const { return ExitVal; }

0 commit comments

Comments
 (0)