Merge branch 'backend' into deploy-20250820
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
extern int DEBUG;
|
||||
extern int DEEPDEBUG;
|
||||
extern int optLevel;
|
||||
|
||||
namespace sysy {
|
||||
|
||||
|
||||
@@ -326,12 +326,19 @@ public:
|
||||
void addBlock(std::unique_ptr<MachineBasicBlock> block) {
|
||||
blocks.push_back(std::move(block));
|
||||
}
|
||||
void addProtectedArgumentVReg(unsigned vreg) {
|
||||
protected_argument_vregs.insert(vreg);
|
||||
}
|
||||
const std::set<unsigned>& getProtectedArgumentVRegs() const {
|
||||
return protected_argument_vregs;
|
||||
}
|
||||
private:
|
||||
Function* F;
|
||||
RISCv64ISel* isel; // 指向创建它的ISel,用于获取vreg映射等信息
|
||||
std::string name;
|
||||
std::vector<std::unique_ptr<MachineBasicBlock>> blocks;
|
||||
StackFrameInfo frame_info;
|
||||
std::set<unsigned> protected_argument_vregs;
|
||||
};
|
||||
inline bool isMemoryOp(RVOpcodes opcode) {
|
||||
switch (opcode) {
|
||||
|
||||
@@ -45,12 +45,11 @@ private:
|
||||
void rewriteProgram();
|
||||
bool doAllocation();
|
||||
void applyColoring();
|
||||
|
||||
void dumpState(const std::string &stage);
|
||||
|
||||
void precolorByCallingConvention();
|
||||
void protectCrossCallVRegs();
|
||||
|
||||
// --- 辅助函数 ---
|
||||
void dumpState(const std::string &stage);
|
||||
void getInstrUseDef(const MachineInstr* instr, VRegSet& use, VRegSet& def);
|
||||
void getInstrUseDef_Liveness(const MachineInstr *instr, VRegSet &use, VRegSet &def);
|
||||
void addEdge(unsigned u, unsigned v);
|
||||
|
||||
Reference in New Issue
Block a user