write phi elimination
This commit is contained in:
@ -8,8 +8,10 @@
|
||||
using CFGNodeCollection = std::list<class CFGNodeType *>;
|
||||
class CFGNodeType {
|
||||
public:
|
||||
// successors, predecessors, corresponding_block is provided by BuildCFGForFunction
|
||||
std::vector<CFGNodeType *> successors, predecessors;
|
||||
BlockItem *corresponding_block;
|
||||
// the following fields are provided by user
|
||||
CFGNodeCollection dom;
|
||||
bool visited;
|
||||
CFGNodeType *idom;
|
||||
|
@ -1,2 +1,3 @@
|
||||
#include "cfg.h"
|
||||
#include "mem2reg.h"
|
||||
#include "cfg.h"
|
||||
#include "regalloc.h"
|
18
include/opt/phieliminate.h
Normal file
18
include/opt/phieliminate.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "IR/IR_basic.h"
|
||||
#include "cfg.h"
|
||||
|
||||
namespace opt {
|
||||
class MoveInstruct : public ActionItem {
|
||||
public:
|
||||
std::string src_full;
|
||||
std::string dest_full;
|
||||
MoveInstruct() = default;
|
||||
void RecursivePrint(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);
|
2
include/opt/regalloc.h
Normal file
2
include/opt/regalloc.h
Normal file
@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
#include "phieliminate.h"
|
Reference in New Issue
Block a user