diff options
author | Kazu Hirata <kazu@google.com> | 2025-02-18 08:38:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-18 08:38:50 -0800 |
commit | e0ed5e8db98ebcf58a94cc730c6927cb85db41b5 (patch) | |
tree | 046cb1679da8d935b1685ee2d40aea6154a33841 /llvm/lib/Analysis/InlineCost.cpp | |
parent | 7a5d1e994600eb01716e7b7f784e26672ba8d623 (diff) | |
download | llvm-e0ed5e8db98ebcf58a94cc730c6927cb85db41b5.zip llvm-e0ed5e8db98ebcf58a94cc730c6927cb85db41b5.tar.gz llvm-e0ed5e8db98ebcf58a94cc730c6927cb85db41b5.tar.bz2 |
[Analysis] Avoid repeated hash lookups (NFC) (#127574)
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 8fa150f..c6b927c 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -795,8 +795,9 @@ class InlineCostCallAnalyzer final : public CallAnalyzer { // the given instruction was assessed. if (!PrintInstructionComments) return; - InstructionCostDetailMap[I].CostBefore = Cost; - InstructionCostDetailMap[I].ThresholdBefore = Threshold; + auto &CostDetail = InstructionCostDetailMap[I]; + CostDetail.CostBefore = Cost; + CostDetail.ThresholdBefore = Threshold; } void onInstructionAnalysisFinish(const Instruction *I) override { @@ -804,8 +805,9 @@ class InlineCostCallAnalyzer final : public CallAnalyzer { // the instruction has been assessed. if (!PrintInstructionComments) return; - InstructionCostDetailMap[I].CostAfter = Cost; - InstructionCostDetailMap[I].ThresholdAfter = Threshold; + auto &CostDetail = InstructionCostDetailMap[I]; + CostDetail.CostAfter = Cost; + CostDetail.ThresholdAfter = Threshold; } bool isCostBenefitAnalysisEnabled() { |