Skip to content

Commit ef94d8a

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (llvm#129652)
1 parent 7a06681 commit ef94d8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/MachineBlockPlacement.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,12 +1792,12 @@ MachineBasicBlock *MachineBlockPlacement::getFirstUnplacedBlock(
17921792

17931793
for (MachineFunction::iterator I = PrevUnplacedBlockIt, E = F->end(); I != E;
17941794
++I) {
1795-
if (BlockToChain[&*I] != &PlacedChain) {
1795+
if (BlockChain *Chain = BlockToChain[&*I]; Chain != &PlacedChain) {
17961796
PrevUnplacedBlockIt = I;
17971797
// Now select the head of the chain to which the unplaced block belongs
17981798
// as the block to place. This will force the entire chain to be placed,
17991799
// and satisfies the requirements of merging chains.
1800-
return *BlockToChain[&*I]->begin();
1800+
return *Chain->begin();
18011801
}
18021802
}
18031803
return nullptr;

0 commit comments

Comments
 (0)