[backend]微优化与可读性维护不影响原逻辑和分数
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user