From ef94d8a0f2d885d1753cd39c1ea76fe21a69d93b Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 4 Mar 2025 01:49:48 -0800 Subject: [CodeGen] Avoid repeated hash lookups (NFC) (#129652) --- llvm/lib/CodeGen/MachineBlockPlacement.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp') diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index c61b8eb..9ccfadc 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -1792,12 +1792,12 @@ MachineBasicBlock *MachineBlockPlacement::getFirstUnplacedBlock( for (MachineFunction::iterator I = PrevUnplacedBlockIt, E = F->end(); I != E; ++I) { - if (BlockToChain[&*I] != &PlacedChain) { + if (BlockChain *Chain = BlockToChain[&*I]; Chain != &PlacedChain) { PrevUnplacedBlockIt = I; // Now select the head of the chain to which the unplaced block belongs // as the block to place. This will force the entire chain to be placed, // and satisfies the requirements of merging chains. - return *BlockToChain[&*I]->begin(); + return *Chain->begin(); } } return nullptr; -- cgit v1.1