ready to conduct Conflict Graph Coloring

This commit is contained in:
2024-10-20 02:51:03 +00:00
parent 18105a9bf5
commit 5468e8468d
5 changed files with 112 additions and 13 deletions

View File

@ -40,6 +40,19 @@ class CFGType {
FunctionDefItem *corresponding_func;
};
namespace opt {
class MoveInstruct : public ActionItem {
public:
std::string src_full;
std::string dest_full;
LLVMType ty;
MoveInstruct() = default;
void RecursivePrint([[maybe_unused]] std::ostream &os) const {
throw std::runtime_error("Move instruction is not an actual LLVM IR instruction");
}
};
} // namespace opt
template <typename Container, typename Compare = std::less<typename Container::value_type>>
Container GetCollectionsIntersection(const Container &a, const Container &b, Compare comp = Compare()) {
Container result;

View File

@ -33,4 +33,15 @@ class LoadSpilledArgs : public ActionItem {
throw std::runtime_error("LoadSpilledArgs instruction is not an actual LLVM IR instruction");
}
};
class StoreSpilledArgs : public ActionItem {
public:
size_t arg_id; // [8,+inf)
std::string var_full;
LLVMType ty;
StoreSpilledArgs() = default;
void RecursivePrint(std::ostream &os) const {
throw std::runtime_error("StoreSpilledArgs instruction is not an actual LLVM IR instruction");
}
};
} // namespace opt

View File

@ -2,17 +2,4 @@
#include "IR/IR_basic.h"
#include "cfg.h"
namespace opt {
class MoveInstruct : public ActionItem {
public:
std::string src_full;
std::string dest_full;
LLVMType ty;
MoveInstruct() = default;
void RecursivePrint([[maybe_unused]] std::ostream &os) const {
throw std::runtime_error("Move instruction is not an actual LLVM IR instruction");
}
};
} // namespace opt
std::shared_ptr<ModuleItem> PhiEliminate(std::shared_ptr<ModuleItem> src);