diff --git a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h --- a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h +++ b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h @@ -128,14 +128,13 @@ bool ComputeValueKnownInPredecessorsImpl( Value *V, BasicBlock *BB, jumpthreading::PredValueInfo &Result, jumpthreading::ConstantPreference Preference, - DenseSet> &RecursionSet, - Instruction *CxtI = nullptr); + DenseSet &RecursionSet, Instruction *CxtI = nullptr); bool ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB, jumpthreading::PredValueInfo &Result, jumpthreading::ConstantPreference Preference, Instruction *CxtI = nullptr) { - DenseSet> RecursionSet; + DenseSet RecursionSet; return ComputeValueKnownInPredecessorsImpl(V, BB, Result, Preference, RecursionSet, CxtI); } diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp --- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp +++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp @@ -611,14 +611,13 @@ /// This returns true if there were any known values. bool JumpThreadingPass::ComputeValueKnownInPredecessorsImpl( Value *V, BasicBlock *BB, PredValueInfo &Result, - ConstantPreference Preference, - DenseSet> &RecursionSet, + ConstantPreference Preference, DenseSet &RecursionSet, Instruction *CxtI) { // This method walks up use-def chains recursively. Because of this, we could // get into an infinite loop going around loops in the use-def chain. To // prevent this, keep track of what (value, block) pairs we've already visited // and terminate the search if we loop back to them - if (!RecursionSet.insert(std::make_pair(V, BB)).second) + if (!RecursionSet.insert(V).second) return false; // If V is a constant, then it is known in all predecessors.