[backend]微优化与可读性维护不影响原逻辑和分数

This commit is contained in:
2025-07-31 11:23:17 +08:00
parent b3cf3cba29
commit 807fb3f560
3 changed files with 49 additions and 55 deletions

View File

@ -152,17 +152,18 @@ void RISCv64ISel::selectBasicBlock(BasicBlock* bb) {
for (const auto& inst_ptr : bb->getInstructions()) {
DAGNode* node_to_select = nullptr;
if (value_to_node.count(inst_ptr.get())) {
node_to_select = value_to_node.at(inst_ptr.get());
auto it = value_to_node.find(inst_ptr.get());
if (it != value_to_node.end()) {
node_to_select = it->second;
} else {
for(const auto& node : dag) {
if(node->value == inst_ptr.get()) {
node_to_select = node.get();
break;
}
for(const auto& node : dag) {
if(node->value == inst_ptr.get()) {
node_to_select = node.get();
break;
}
}
if(node_to_select) {
}
if(node_to_select) {
select_recursive(node_to_select);
}
}