diff --git a/llvm/include/llvm/Transforms/Scalar/Float2Int.h b/llvm/include/llvm/Transforms/Scalar/Float2Int.h --- a/llvm/include/llvm/Transforms/Scalar/Float2Int.h +++ b/llvm/include/llvm/Transforms/Scalar/Float2Int.h @@ -30,20 +30,22 @@ bool runImpl(Function &F, const DominatorTree &DT); private: + using RootSet = SmallPtrSet; + void findRoots(Function &F, const DominatorTree &DT, - SmallPtrSet &Roots); + RootSet &Roots); void seen(Instruction *I, ConstantRange R); ConstantRange badRange(); ConstantRange unknownRange(); ConstantRange validateRange(ConstantRange R); - void walkBackwards(const SmallPtrSetImpl &Roots); + void walkBackwards(const RootSet &Roots); void walkForwards(); bool validateAndTransform(); Value *convert(Instruction *I, Type *ToTy); void cleanup(); MapVector SeenInsts; - SmallPtrSet Roots; + RootSet Roots; EquivalenceClasses ECs; MapVector ConvertedInsts; LLVMContext *Ctx; diff --git a/llvm/lib/Transforms/Scalar/Float2Int.cpp b/llvm/lib/Transforms/Scalar/Float2Int.cpp --- a/llvm/lib/Transforms/Scalar/Float2Int.cpp +++ b/llvm/lib/Transforms/Scalar/Float2Int.cpp @@ -121,7 +121,7 @@ // Find the roots - instructions that convert from the FP domain to // integer domain. void Float2IntPass::findRoots(Function &F, const DominatorTree &DT, - SmallPtrSet &Roots) { + RootSet &Roots) { for (BasicBlock &BB : F) { // Unreachable code can take on strange forms that we are not prepared to // handle. For example, an instruction may have itself as an operand. @@ -184,7 +184,7 @@ // Breadth-first walk of the use-def graph; determine the set of nodes // we care about and eagerly determine if some of them are poisonous. -void Float2IntPass::walkBackwards(const SmallPtrSetImpl &Roots) { +void Float2IntPass::walkBackwards(const RootSet &Roots) { std::deque Worklist(Roots.begin(), Roots.end()); while (!Worklist.empty()) { Instruction *I = Worklist.back();