aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-02-19 08:21:53 -0800
committerGitHub <noreply@github.com>2025-02-19 08:21:53 -0800
commitfc5849de6abba74dd0bb9a062b207ba4fcd7a37d (patch)
tree00ce6da8594b9d50b57ba64c577168fd269a86bc
parentbb75a96900ad52b01e51fc42c3533a6febf97e27 (diff)
downloadllvm-fc5849de6abba74dd0bb9a062b207ba4fcd7a37d.zip
llvm-fc5849de6abba74dd0bb9a062b207ba4fcd7a37d.tar.gz
llvm-fc5849de6abba74dd0bb9a062b207ba4fcd7a37d.tar.bz2
[X86] Avoid repeated hash lookups (NFC) (#127748)
-rw-r--r--llvm/lib/Target/X86/X86PadShortFunction.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86PadShortFunction.cpp b/llvm/lib/Target/X86/X86PadShortFunction.cpp
index c43fd97..2859195 100644
--- a/llvm/lib/Target/X86/X86PadShortFunction.cpp
+++ b/llvm/lib/Target/X86/X86PadShortFunction.cpp
@@ -163,7 +163,8 @@ void PadShortFunc::findReturns(MachineBasicBlock *MBB, unsigned int Cycles) {
return;
if (hasReturn) {
- ReturnBBs[MBB] = std::max(ReturnBBs[MBB], Cycles);
+ unsigned int &NumCycles = ReturnBBs[MBB];
+ NumCycles = std::max(NumCycles, Cycles);
return;
}