Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 91e5a4e38acf8e6d02edf9ca8d84ca8737ef430c
https://github.com/WebKit/WebKit/commit/91e5a4e38acf8e6d02edf9ca8d84ca8737ef430c
Author: Dan Hecht <[email protected]>
Date: 2025-12-11 (Thu, 11 Dec 2025)
Changed paths:
M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp
M Source/JavaScriptCore/b3/air/AirTmpMap.h
Log Message:
-----------
[JSC] Add an Air::TmpMap accessor with bank as a template parameter
https://bugs.webkit.org/show_bug.cgi?id=303942
rdar://166252589
Reviewed by Yusuke Suzuki.
The register allocator wants to do initial analysis over the IR without
respect to the register bank (to avoid repeated IR passes) when bank is
irrelevant. The allocator also needs to be able to create new Tmps as
it runs. So, the allocator uses Air::TmpMap rather than a flat vector.
However, the core register allocation algorithm is run over each bank
independently. So, introduce a templated on bank accessor to TmpMap so
that the bank branch in the TmpMap lookup can be resolved at compile time.
This seems to speed up register allocation by about 1-2% (though it's
hard to measure exactly).
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
(JSC::B3::Air::Greedy::GreedyAllocator::groupForTmp):
(JSC::B3::Air::Greedy::GreedyAllocator::assignedReg):
(JSC::B3::Air::Greedy::GreedyAllocator::validateAssignments):
(JSC::B3::Air::Greedy::GreedyAllocator::finalizeGroups):
(JSC::B3::Air::Greedy::GreedyAllocator::initSpillCosts):
(JSC::B3::Air::Greedy::GreedyAllocator::allocateRegisters):
(JSC::B3::Air::Greedy::GreedyAllocator::tryAllocate):
(JSC::B3::Air::Greedy::GreedyAllocator::tryEvict):
(JSC::B3::Air::Greedy::GreedyAllocator::trySplit):
(JSC::B3::Air::Greedy::GreedyAllocator::trySplitGroup):
(JSC::B3::Air::Greedy::GreedyAllocator::trySplitAroundClobbers):
(JSC::B3::Air::Greedy::GreedyAllocator::trySplitIntraBlock):
(JSC::B3::Air::Greedy::GreedyAllocator::emitSpillCodeAndEnqueueNewTmps):
* Source/JavaScriptCore/b3/air/AirTmpMap.h:
(JSC::B3::Air::TmpMap::get const):
(JSC::B3::Air::TmpMap::get):
Canonical link: https://commits.webkit.org/304300@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications