Skip to content

Commit fdf9bad

Browse files
committed
[Float2Int] Stop passing around a reference to the class member Roots. NFC
The Float2IntPass got a class member called Roots, but Roots was also passed around to member function as a reference. This patch simply remove those references.
1 parent 07c1978 commit fdf9bad

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

llvm/include/llvm/Transforms/Scalar/Float2Int.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ class Float2IntPass : public PassInfoMixin<Float2IntPass> {
3030
bool runImpl(Function &F, const DominatorTree &DT);
3131

3232
private:
33-
void findRoots(Function &F, const DominatorTree &DT,
34-
SmallPtrSet<Instruction *, 8> &Roots);
33+
void findRoots(Function &F, const DominatorTree &DT);
3534
void seen(Instruction *I, ConstantRange R);
3635
ConstantRange badRange();
3736
ConstantRange unknownRange();
3837
ConstantRange validateRange(ConstantRange R);
39-
void walkBackwards(const SmallPtrSetImpl<Instruction *> &Roots);
38+
void walkBackwards();
4039
void walkForwards();
4140
bool validateAndTransform();
4241
Value *convert(Instruction *I, Type *ToTy);

llvm/lib/Transforms/Scalar/Float2Int.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ static Instruction::BinaryOps mapBinOpcode(unsigned Opcode) {
120120

121121
// Find the roots - instructions that convert from the FP domain to
122122
// integer domain.
123-
void Float2IntPass::findRoots(Function &F, const DominatorTree &DT,
124-
SmallPtrSet<Instruction*,8> &Roots) {
123+
void Float2IntPass::findRoots(Function &F, const DominatorTree &DT) {
125124
for (BasicBlock &BB : F) {
126125
// Unreachable code can take on strange forms that we are not prepared to
127126
// handle. For example, an instruction may have itself as an operand.
@@ -184,7 +183,7 @@ ConstantRange Float2IntPass::validateRange(ConstantRange R) {
184183

185184
// Breadth-first walk of the use-def graph; determine the set of nodes
186185
// we care about and eagerly determine if some of them are poisonous.
187-
void Float2IntPass::walkBackwards(const SmallPtrSetImpl<Instruction*> &Roots) {
186+
void Float2IntPass::walkBackwards() {
188187
std::deque<Instruction*> Worklist(Roots.begin(), Roots.end());
189188
while (!Worklist.empty()) {
190189
Instruction *I = Worklist.back();
@@ -525,9 +524,9 @@ bool Float2IntPass::runImpl(Function &F, const DominatorTree &DT) {
525524

526525
Ctx = &F.getParent()->getContext();
527526

528-
findRoots(F, DT, Roots);
527+
findRoots(F, DT);
529528

530-
walkBackwards(Roots);
529+
walkBackwards();
531530
walkForwards();
532531

533532
bool Modified = validateAndTransform();

0 commit comments

Comments
 (0)