Skip to content

Commit 5dd655e

Browse files
[PowerPC] Avoid repeated hash lookups (NFC) (#132659)
1 parent 1904241 commit 5dd655e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/PowerPC/PPCFastISel.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,17 +2263,17 @@ Register PPCFastISel::fastMaterializeConstant(const Constant *C) {
22632263
// Materialize the address created by an alloca into a register, and
22642264
// return the register number (or zero if we failed to handle it).
22652265
Register PPCFastISel::fastMaterializeAlloca(const AllocaInst *AI) {
2266+
DenseMap<const AllocaInst *, int>::iterator SI =
2267+
FuncInfo.StaticAllocaMap.find(AI);
2268+
22662269
// Don't handle dynamic allocas.
2267-
if (!FuncInfo.StaticAllocaMap.count(AI))
2270+
if (SI == FuncInfo.StaticAllocaMap.end())
22682271
return Register();
22692272

22702273
MVT VT;
22712274
if (!isLoadTypeLegal(AI->getType(), VT))
22722275
return Register();
22732276

2274-
DenseMap<const AllocaInst*, int>::iterator SI =
2275-
FuncInfo.StaticAllocaMap.find(AI);
2276-
22772277
if (SI != FuncInfo.StaticAllocaMap.end()) {
22782278
Register ResultReg = createResultReg(&PPC::G8RC_and_G8RC_NOX0RegClass);
22792279
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, MIMD, TII.get(PPC::ADDI8),

0 commit comments

Comments
 (0)