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

Get rid of most spills

parent abeaa843
No related branches found
No related tags found
1 merge request!136Dip collection constants into device functions and loops
Pipeline #201274 passed
......@@ -421,6 +421,9 @@ fn basic_blocks(
// If the next node further up the dominator tree is in a shallower
// loop nest or if we can get out of a reduce loop when we don't
// need to be in one, place this data node in a higher-up location.
// Only do this is the node isn't a constant or undef.
let is_constant_or_undef =
function.nodes[id.idx()].is_constant() || function.nodes[id.idx()].is_undef();
let old_nest = loops
.header_of(location)
.map(|header| loops.nesting(header).unwrap());
......@@ -441,7 +444,7 @@ fn basic_blocks(
// loop use the reduce node forming the loop, so the dominator chain
// will consist of one block, and this loop won't ever iterate.
let currently_at_join = function.nodes[location.idx()].is_join();
if shallower_nest || currently_at_join {
if !is_constant_or_undef && (shallower_nest || currently_at_join) {
location = control_node;
}
}
......
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