From bd0d1a94525f0effbd90b2ddcb5443e29b5d0a08 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 18 Oct 2024 08:58:49 -0700 Subject: [PATCH] [InstCombine] Simplify code with SmallMapVector::operator[] (NFC) --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 72ebd9fbb6d9e..d9d41e052a32a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -870,8 +870,7 @@ bool InstCombinerImpl::foldAllocaCmp(AllocaInst *Alloca) { if (ICmp && ICmp->isEquality() && getUnderlyingObject(*U) == Alloca) { // Collect equality icmps of the alloca, and don't treat them as // captures. - auto Res = ICmps.insert({ICmp, 0}); - Res.first->second |= 1u << U->getOperandNo(); + ICmps[ICmp] |= 1u << U->getOperandNo(); return false; }