LibJS: Avoid unnecessary copies in PlaceBlocks codegen pass

This commit is contained in:
Ben Wiederhake 2021-12-24 21:38:33 +01:00 committed by Andreas Kling
commit a1aea5b9e0
Notes: sideshowbarker 2024-07-18 03:23:00 +09:00

View file

@ -26,7 +26,11 @@ void PlaceBlocks::perform(PassPipelineExecutable& executable)
reachable_blocks.set(block);
replaced_blocks.append(*const_cast<BasicBlock*>(block));
for (auto& entry : cfg.get(block).value_or({}))
auto children = cfg.find(block);
if (children == cfg.end())
return;
for (auto& entry : children->value)
visit(entry);
};