Skip to content

Commit 5addbf0

Browse files
[AArch64] Avoid repeated hash lookups (NFC) (#130542)
1 parent c480874 commit 5addbf0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Target/AArch64/AArch64FastISel.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,10 @@ Register AArch64FastISel::fastMaterializeAlloca(const AllocaInst *AI) {
346346
"Alloca should always return a pointer.");
347347

348348
// Don't handle dynamic allocas.
349-
if (!FuncInfo.StaticAllocaMap.count(AI))
349+
auto SI = FuncInfo.StaticAllocaMap.find(AI);
350+
if (SI == FuncInfo.StaticAllocaMap.end())
350351
return Register();
351352

352-
DenseMap<const AllocaInst *, int>::iterator SI =
353-
FuncInfo.StaticAllocaMap.find(AI);
354-
355353
if (SI != FuncInfo.StaticAllocaMap.end()) {
356354
Register ResultReg = createResultReg(&AArch64::GPR64spRegClass);
357355
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(AArch64::ADDXri),

0 commit comments

Comments
 (0)