[llvm] [AArch64] Avoid repeated hash lookups (NFC) (PR #130542)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 9 20:49:57 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/130542
None
>From 26265a0e72af407c8aa2d03f61aafc6b5dae9d6a Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 9 Mar 2025 00:54:08 -0800
Subject: [PATCH] [AArch64] Avoid repeated hash lookups (NFC)
---
llvm/lib/Target/AArch64/AArch64FastISel.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
index 8961283fe7449..5ef439f8224c1 100644
--- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
@@ -346,12 +346,10 @@ Register AArch64FastISel::fastMaterializeAlloca(const AllocaInst *AI) {
"Alloca should always return a pointer.");
// Don't handle dynamic allocas.
- if (!FuncInfo.StaticAllocaMap.count(AI))
+ auto SI = FuncInfo.StaticAllocaMap.find(AI);
+ if (SI == FuncInfo.StaticAllocaMap.end())
return Register();
- DenseMap<const AllocaInst *, int>::iterator SI =
- FuncInfo.StaticAllocaMap.find(AI);
-
if (SI != FuncInfo.StaticAllocaMap.end()) {
Register ResultReg = createResultReg(&AArch64::GPR64spRegClass);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(AArch64::ADDXri),
More information about the llvm-commits
mailing list