diff options
author | Kazu Hirata <kazu@google.com> | 2024-10-16 06:41:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 06:41:40 -0700 |
commit | f5d3c87ede965d3cb4dd58aeed0a0b94e674b997 (patch) | |
tree | b62083d6367cb8035f21a953764552735cf533b6 | |
parent | 9128077c88f0112b4a5b1f64922247793250001b (diff) | |
download | llvm-f5d3c87ede965d3cb4dd58aeed0a0b94e674b997.zip llvm-f5d3c87ede965d3cb4dd58aeed0a0b94e674b997.tar.gz llvm-f5d3c87ede965d3cb4dd58aeed0a0b94e674b997.tar.bz2 |
[IPO] Simplify code with StringMap::operator[] (NFC) (#112490)
-rw-r--r-- | llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h b/llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h index 076d91a..4e757b2 100644 --- a/llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h +++ b/llvm/include/llvm/Transforms/IPO/SampleProfileMatcher.h @@ -201,9 +201,7 @@ private: void UpdateWithSalvagedProfiles(); LocToLocMap &getIRToProfileLocationMap(const Function &F) { - auto Ret = FuncMappings.try_emplace( - FunctionSamples::getCanonicalFnName(F.getName()), LocToLocMap()); - return Ret.first->second; + return FuncMappings[FunctionSamples::getCanonicalFnName(F.getName())]; } void distributeIRToProfileLocationMap(); void distributeIRToProfileLocationMap(FunctionSamples &FS); |