Skip to content
Snippets Groups Projects
Commit ca9b2bf9 authored by Russel Arbore's avatar Russel Arbore
Browse files

Hm

parent 76338dee
No related branches found
No related tags found
1 merge request!195Misc. GPU improvements
Pipeline #201805 passed
......@@ -25,6 +25,7 @@ pub fn outline(
dom: &DomTree,
mut partition: BTreeSet<NodeID>,
to_be_function_id: FunctionID,
outline_scalar_constants: bool,
) -> Option<Function> {
// Step 1: do a whole bunch of analysis on the partition.
let nodes = &editor.func().nodes;
......@@ -34,12 +35,14 @@ pub fn outline(
.any(|id| nodes[id.idx()].is_start() || nodes[id.idx()].is_parameter() || nodes[id.idx()].is_return()),
"PANIC: Can't outline a partition containing the start node, parameter nodes, or return nodes."
);
for (idx, node) in nodes.into_iter().enumerate() {
if let Node::Constant { id } = node
&& editor.get_constant(*id).is_scalar()
{
// Usually, you don't want to explicitly outline scalar constants.
partition.remove(&NodeID::new(idx));
if !outline_scalar_constants {
for (idx, node) in nodes.into_iter().enumerate() {
if let Node::Constant { id } = node
&& editor.get_constant(*id).is_scalar()
{
// Usually, you don't want to explicitly outline scalar constants.
partition.remove(&NodeID::new(idx));
}
}
}
let mut top_nodes = partition.iter().filter(|id| {
......@@ -621,5 +624,6 @@ pub fn dumb_outline(
dom,
partition,
to_be_function_id,
true,
)
}
......@@ -2160,6 +2160,7 @@ fn run_pass(
&doms[func.idx()],
nodes,
new_func_id,
false,
);
let Some(new_func) = new_func else {
return Err(SchedulerError::PassError {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment