[backend]添加了一些工具函数
This commit is contained in:
@@ -122,30 +122,6 @@ void RISCv64RegAlloc::precolorByCallingConvention() {
|
||||
}
|
||||
}
|
||||
|
||||
// // --- 部分2:为CALL指令的返回值预着色 ---
|
||||
// for (auto& mbb : MFunc->getBlocks()) {
|
||||
// for (auto& instr : mbb->getInstructions()) {
|
||||
// if (instr->getOpcode() == RVOpcodes::CALL) {
|
||||
// if (!instr->getOperands().empty() &&
|
||||
// instr->getOperands().front()->getKind() == MachineOperand::KIND_REG)
|
||||
// {
|
||||
// auto reg_op = static_cast<RegOperand*>(instr->getOperands().front().get());
|
||||
// if (reg_op->isVirtual()) {
|
||||
// unsigned ret_vreg = reg_op->getVRegNum();
|
||||
// assert(vreg_to_value_map.count(ret_vreg) && "Return vreg not found!");
|
||||
// Value* ret_val = vreg_to_value_map.at(ret_vreg);
|
||||
|
||||
// if (ret_val->getType()->isFloat()) {
|
||||
// color_map[ret_vreg] = PhysicalReg::F10; // fa0
|
||||
// } else {
|
||||
// color_map[ret_vreg] = PhysicalReg::A0; // a0
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 将所有预着色的vreg视为已着色节点
|
||||
for(const auto& pair : color_map) {
|
||||
coloredNodes.insert(pair.first);
|
||||
|
||||
Reference in New Issue
Block a user