[PostRA_Scheduler]修复了超大测例卡死的bug
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
#include "PostRA_Scheduler.h"
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#define MAX_SCHEDULING_BLOCK_SIZE 10000 // 限制调度块大小,避免过大导致性能问题
|
||||
|
||||
namespace sysy {
|
||||
|
||||
@ -306,6 +306,9 @@ void validateSchedule(const std::vector<MachineInstr*>& instr_list) {
|
||||
void scheduleBlock(MachineBasicBlock* mbb) {
|
||||
auto& instructions = mbb->getInstructions();
|
||||
if (instructions.size() <= 1) return;
|
||||
if (instructions.size() > MAX_SCHEDULING_BLOCK_SIZE) {
|
||||
return; // 跳过超大块,防止卡住
|
||||
}
|
||||
|
||||
std::vector<MachineInstr*> instr_list;
|
||||
for (auto& instr : instructions) {
|
||||
|
||||
Reference in New Issue
Block a user