We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec60030 commit c3fc763Copy full SHA for c3fc763
llvm/lib/MCA/HardwareUnits/ResourceManager.cpp
@@ -322,12 +322,11 @@ uint64_t ResourceManager::checkAvailability(const InstrDesc &Desc) const {
322
323
uint64_t ResourceMask = llvm::bit_floor(ReadyMask);
324
325
- auto it = AvailableUnits.find(ResourceMask);
326
- if (it == AvailableUnits.end()) {
+ auto [it, Inserted] = AvailableUnits.try_emplace(ResourceMask);
+ if (Inserted) {
327
unsigned Index = getResourceStateIndex(ResourceMask);
328
unsigned NumUnits = llvm::popcount(Resources[Index]->getReadyMask());
329
- it =
330
- AvailableUnits.insert(std::make_pair(ResourceMask, NumUnits)).first;
+ it->second = NumUnits;
331
}
332
333
if (!it->second) {
0 commit comments