From: Rahman Lavaee Date: Tue, 18 Apr 2023 21:19:28 +0000 (+0000) Subject: Refactor BasicBlockSectionsProfileReader::getBBClusterInfoForFunction. X-Git-Tag: upstream/17.0.6~11153 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef8dedc79ce02710ffba6a3005e05672702f555f;p=platform%2Fupstream%2Fllvm.git Refactor BasicBlockSectionsProfileReader::getBBClusterInfoForFunction. --- diff --git a/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp b/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp index 5bc8d82..8929955 100644 --- a/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp +++ b/llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp @@ -35,13 +35,10 @@ bool BasicBlockSectionsProfileReader::isFunctionHot(StringRef FuncName) const { std::pair> BasicBlockSectionsProfileReader::getBBClusterInfoForFunction( StringRef FuncName) const { - std::pair> cluster_info(false, {}); auto R = ProgramBBClusterInfo.find(getAliasName(FuncName)); - if (R != ProgramBBClusterInfo.end()) { - cluster_info.second = R->second; - cluster_info.first = true; - } - return cluster_info; + return R != ProgramBBClusterInfo.end() + ? std::pair(true, R->second) + : std::pair(false, SmallVector{}); } // Basic Block Sections can be enabled for a subset of machine basic blocks.