Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DataflowParent OpTag #323

Merged
merged 5 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/ops/tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ pub enum OpTag {
/// A function definition.
FuncDefn,

/// Node in a Control-flow Sibling Graph
/// Node in a Control-flow Sibling Graph.
ControlFlowChild,
/// Node in a Dataflow Sibling Graph.
DataflowChild,
/// Parent node of a Dataflow Sibling Graph.
DataflowParent,

/// A nested data-flow operation.
Dfg,
/// A nested control-flow operation.
Expand Down Expand Up @@ -103,24 +106,25 @@ impl OpTag {
OpTag::Output => &[OpTag::DataflowChild],
OpTag::Function => &[OpTag::ModuleOp],
OpTag::Alias => &[OpTag::ScopedDefn],
OpTag::FuncDefn => &[OpTag::Function, OpTag::ScopedDefn],
OpTag::BasicBlock => &[OpTag::ControlFlowChild],
OpTag::FuncDefn => &[OpTag::Function, OpTag::ScopedDefn, OpTag::DataflowParent],
OpTag::BasicBlock => &[OpTag::ControlFlowChild, OpTag::DataflowParent],
OpTag::BasicBlockExit => &[OpTag::BasicBlock],
OpTag::Case => &[OpTag::Any],
OpTag::Case => &[OpTag::Any, OpTag::DataflowParent],
OpTag::ModuleRoot => &[OpTag::Any],
OpTag::Const => &[OpTag::ScopedDefn],
OpTag::Dfg => &[OpTag::DataflowChild],
OpTag::Dfg => &[OpTag::DataflowChild, OpTag::DataflowParent],
OpTag::Cfg => &[OpTag::DataflowChild],
OpTag::ScopedDefn => &[
OpTag::DataflowChild,
OpTag::ControlFlowChild,
OpTag::ModuleOp,
],
OpTag::TailLoop => &[OpTag::DataflowChild],
OpTag::TailLoop => &[OpTag::DataflowChild, OpTag::DataflowParent],
OpTag::Conditional => &[OpTag::DataflowChild],
OpTag::FnCall => &[OpTag::DataflowChild],
OpTag::LoadConst => &[OpTag::DataflowChild],
OpTag::Leaf => &[OpTag::DataflowChild],
OpTag::DataflowParent => &[OpTag::Any],
}
}

Expand Down Expand Up @@ -150,6 +154,7 @@ impl OpTag {
OpTag::LoadConst => "Constant load operation",
OpTag::Leaf => "Leaf operation",
OpTag::ScopedDefn => "Definitions that can live at global or local scope",
OpTag::DataflowParent => "Operation with input and output children",
}
}

Expand Down