Even if loads are initially duplicated for each user, with new
optimizations such as folding modifiers, it may happen that loads
end up with only users in different blocks.
Handle that and don't delete or pipeline those nodes.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24246>
static bool ppir_lower_load(ppir_block *block, ppir_node *node)
{
ppir_dest *dest = ppir_node_get_dest(node);
- if (ppir_node_is_root(node) && dest->type == ppir_target_ssa) {
+ if (ppir_node_is_root(node) && !node->succ_different_block &&
+ dest->type == ppir_target_ssa) {
ppir_node_delete(node);
return true;
}
* that has load node in source
*/
if ((ppir_node_has_single_src_succ(node) || ppir_node_is_root(node)) &&
- dest->type != ppir_target_register) {
+ !node->succ_different_block &&
+ dest->type != ppir_target_register) {
ppir_node *succ = ppir_node_first_succ(node);
switch (succ->type) {
case ppir_node_type_alu: