finish live analysis

This commit is contained in:
2024-10-19 07:01:21 +00:00
parent 2e94fba653
commit 24b18756e8
11 changed files with 367 additions and 108 deletions

View File

@ -1 +1,15 @@
#include "regalloc.h"
#include "regalloc.h"
void ConductRegAllocForFunction([[maybe_unused]] std::shared_ptr<FunctionDefItem> func, CFGType &cfg) {
LiveAnalysis(cfg);
}
std::shared_ptr<ModuleItem> RegAlloc(std::shared_ptr<ModuleItem> src) {
auto res = src;
for (auto &func : res->function_defs) {
// func = std::make_shared<FunctionDefItem>(*func);
auto cfg = BuildCFGForFunction(func);
ConductRegAllocForFunction(func, cfg);
}
return res;
}