Skip to content

Commit 3940a1b

Browse files
[Float2Int] Avoid repeated hash lookups (NFC) (#107795)
1 parent 563dc22 commit 3940a1b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

llvm/lib/Transforms/Scalar/Float2Int.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ void Float2IntPass::findRoots(Function &F, const DominatorTree &DT) {
115115
// Helper - mark I as having been traversed, having range R.
116116
void Float2IntPass::seen(Instruction *I, ConstantRange R) {
117117
LLVM_DEBUG(dbgs() << "F2I: " << *I << ":" << R << "\n");
118-
auto IT = SeenInsts.find(I);
119-
if (IT != SeenInsts.end())
120-
IT->second = std::move(R);
121-
else
122-
SeenInsts.insert(std::make_pair(I, std::move(R)));
118+
SeenInsts.insert_or_assign(I, std::move(R));
123119
}
124120

125121
// Helper - get a range representing a poison value.

0 commit comments

Comments
 (0)