Commit efbf4233 authored by 李晓奇's avatar 李晓奇

follow update

parent f0f0bb81
...@@ -6,7 +6,7 @@ AlwaysBreakTemplateDeclarations: true ...@@ -6,7 +6,7 @@ AlwaysBreakTemplateDeclarations: true
BinPackArguments: false BinPackArguments: false
BinPackParameters: false BinPackParameters: false
BreakConstructorInitializers: BeforeComma BreakConstructorInitializers: BeforeComma
ColumnLimit: 120 ColumnLimit: 80
CommentPragmas: '^(!|NOLINT)' CommentPragmas: '^(!|NOLINT)'
ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerAllOnOneLineOrOnePerLine: true
IncludeBlocks: Regroup IncludeBlocks: Regroup
...@@ -23,4 +23,5 @@ PenaltyReturnTypeOnItsOwnLine: 200 ...@@ -23,4 +23,5 @@ PenaltyReturnTypeOnItsOwnLine: 200
SpacesBeforeTrailingComments: 1 SpacesBeforeTrailingComments: 1
TabWidth: 4 TabWidth: 4
UseTab: Never UseTab: Never
AlwaysBreakAfterReturnType: TopLevelDefinitions
... ...
This diff is collapsed.
...@@ -56,6 +56,7 @@ class Instruction : public User, public llvm::ilist_node<Instruction> ...@@ -56,6 +56,7 @@ class Instruction : public User, public llvm::ilist_node<Instruction>
Module *get_module(); Module *get_module();
OpID get_instr_type() const { return op_id_; } OpID get_instr_type() const { return op_id_; }
// clang-format off
static std::string get_instr_op_name(OpID id) { static std::string get_instr_op_name(OpID id) {
switch (id) { switch (id) {
case ret: return "ret"; break; case ret: return "ret"; break;
...@@ -79,12 +80,10 @@ class Instruction : public User, public llvm::ilist_node<Instruction> ...@@ -79,12 +80,10 @@ class Instruction : public User, public llvm::ilist_node<Instruction>
case zext: return "zext"; break; case zext: return "zext"; break;
case fptosi: return "fptosi"; break; case fptosi: return "fptosi"; break;
case sitofp: return "sitofp"; break; case sitofp: return "sitofp"; break;
default: return ""; break;
default:
return "";
break;
} }
} }
// clang-format on
std::string get_instr_op_name() { return get_instr_op_name(op_id_); } std::string get_instr_op_name() { return get_instr_op_name(op_id_); }
bool is_void() bool is_void()
......
...@@ -159,6 +159,7 @@ class GVN : public Pass { ...@@ -159,6 +159,7 @@ class GVN : public Pass {
partitions join(const partitions &P1, const partitions &P2); partitions join(const partitions &P1, const partitions &P2);
std::shared_ptr<CongruenceClass> intersect(std::shared_ptr<CongruenceClass>, std::shared_ptr<CongruenceClass>); std::shared_ptr<CongruenceClass> intersect(std::shared_ptr<CongruenceClass>, std::shared_ptr<CongruenceClass>);
partitions transferFunction(Instruction *x, Value *e, partitions pin); partitions transferFunction(Instruction *x, Value *e, partitions pin);
partitions transferFunction(BasicBlock *bb);
std::shared_ptr<GVNExpression::PhiExpression> valuePhiFunc(std::shared_ptr<GVNExpression::Expression>, std::shared_ptr<GVNExpression::PhiExpression> valuePhiFunc(std::shared_ptr<GVNExpression::Expression>,
const partitions &); const partitions &);
std::shared_ptr<GVNExpression::Expression> valueExpr(Instruction *instr); std::shared_ptr<GVNExpression::Expression> valueExpr(Instruction *instr);
...@@ -176,6 +177,10 @@ class GVN : public Pass { ...@@ -176,6 +177,10 @@ class GVN : public Pass {
return std::make_shared<CongruenceClass>(index); return std::make_shared<CongruenceClass>(index);
} }
// self add
//
std::uint64_t new_number() { return next_value_number_++; }
private: private:
bool dump_json_; bool dump_json_;
std::uint64_t next_value_number_ = 1; std::uint64_t next_value_number_ = 1;
...@@ -184,6 +189,9 @@ class GVN : public Pass { ...@@ -184,6 +189,9 @@ class GVN : public Pass {
std::unique_ptr<FuncInfo> func_info_; std::unique_ptr<FuncInfo> func_info_;
std::unique_ptr<GVNExpression::ConstFolder> folder_; std::unique_ptr<GVNExpression::ConstFolder> folder_;
std::unique_ptr<DeadCode> dce_; std::unique_ptr<DeadCode> dce_;
// self add
std::map<Instruction*, bool> _TOP;
}; };
bool operator==(const GVN::partitions &p1, const GVN::partitions &p2); bool operator==(const GVN::partitions &p1, const GVN::partitions &p2);
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment