Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hitonami committed Jun 9, 2023
1 parent fed6f3e commit 00464bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions taichi/ir/control_flow_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@

namespace taichi::lang {

CFGNode::CFGNode(ControlFlowGraph *graph,
Block *block,
CFGNode::CFGNode(Block *block,
int begin_location,
int end_location,
bool is_parallel_executed,
CFGNode *prev_node_in_same_block)
: graph_(graph),
block(block),
: block(block),
begin_location(begin_location),
end_location(end_location),
is_parallel_executed(is_parallel_executed),
Expand All @@ -39,8 +37,7 @@ CFGNode::CFGNode(ControlFlowGraph *graph,
}
}

CFGNode::CFGNode(ControlFlowGraph *graph)
: CFGNode(graph, nullptr, -1, -1, false, nullptr) {
CFGNode::CFGNode() : CFGNode(nullptr, -1, -1, false, nullptr) {
}

void CFGNode::add_edge(CFGNode *from, CFGNode *to) {
Expand Down
9 changes: 3 additions & 6 deletions taichi/ir/control_flow_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CFGNode {
private:
// For accelerating get_store_forwarding_data()
std::unordered_set<Block *> parent_blocks_;
ControlFlowGraph *graph_;

public:
// This node corresponds to block->statements[i]
Expand All @@ -56,15 +55,14 @@ class CFGNode {
// https://en.wikipedia.org/wiki/Live_variable_analysis
std::unordered_set<Stmt *> live_gen, live_kill, live_in, live_out;

CFGNode(ControlFlowGraph *graph,
Block *block,
CFGNode(Block *block,
int begin_location,
int end_location,
bool is_parallel_executed,
CFGNode *prev_node_in_same_block);

// An empty node
CFGNode(ControlFlowGraph *graph);
CFGNode();

static void add_edge(CFGNode *from, CFGNode *to);

Expand Down Expand Up @@ -121,8 +119,7 @@ class ControlFlowGraph {

template <typename... Args>
CFGNode *push_back(Args &&...args) {
nodes.emplace_back(
std::make_unique<CFGNode>(this, std::forward<Args>(args)...));
nodes.emplace_back(std::make_unique<CFGNode>(std::forward<Args>(args)...));
return nodes.back().get();
}

Expand Down

0 comments on commit 00464bb

Please sign in to comment.