Ok, recreating a new sequence node is doable, but even what you described (collecting the filter), how do I "transplant" the subtrees? i.e. if F_1, ...F_N are the original filter nodes of the sequence, and let's say I want to merge F_k and F_k+1, then I create a new seqence node with filters F_1,.., F_k-1, F_u, F_k+2... F_N where F_u = F_k union F_k+1. But F_1,..,F_k-1 and F_k+2,..F_N don't have any children in the new sequence node! So how do I transplant, e.g. the subtree under old F_1 to be under new F_1? Do I need to traverse those subtrees and recreate them under the new filter nodes? (And similarly, there should a sequence under the fused band node with the two subtrees from under the two original band nodes).
By any chance is this where I need to use one of those `graft` functions? I never successfully managed to use them... I got something like graft needs to have a domain... (I will look into it in more detail if I get a confirmation that this is indeed the function I'm looking for).
Bonus question! (which is kinda a related) How to "get a subtree"? isl_schedule_node feels like a "pointer" within an `isl_schedule`, and e.g. `isl_schedule_node_get_child()` is described as "obtain a copy of a given child without destroying the current node", which (I think) is a bit confusing. Say, if I get such a copy and start messing with the rest of the tree, what happens to the original tree? (I will test this -- but I think the docs are kinda confusing here...).
Anyway, the main question is, "how to get a subtree (so I can transplant it as described above)?". There was a similar question on this mailing list, and you replied with "what transformation do you want to implement?" to the guy asking it. Hope it is clear how it relates to the fusion.
Best,
Emil
Currently I have this (0, 1, 2 mod3 were on separate branches, and I want to merge 0 and 1). This is the state after inserting the new sequence node with the merged 0 and 1 (mod3) branch.
domain: "[N] -> { S_0[i, j] : 0 < i < N and 0 <= j < N }"
child:
sequence:
- filter: "[N] -> { S_0[i, j] : (i) mod 3 = 0 or (-1 + i) mod 3 = 0 }"
child:
# YOU ARE HERE
sequence:
- filter: "[N] -> { S_0[i, j] : (i) mod 3 = 0 }"
child:
schedule: "[N] -> L_0[{ S_0[i, j] -> [(i)] }]"
child:
schedule: "[N] -> L_1[{ S_0[i, j] -> [(j)] }]"
- filter: "[N] -> { S_0[i, j] : (-1 + i) mod 3 = 0 }"
child:
schedule: "[N] -> L_0[{ S_0[i, j] -> [(i)] }]"
child:
schedule: "[N] -> L_1[{ S_0[i, j] -> [(j)] }]"
- filter: "[N] -> { S_0[i, j] : (1 + i) mod 3 = 0 }"
- filter: "[N] -> { S_0[i, j] : (1 + i) mod 3 = 0 }"
child:
schedule: "[N] -> L_0[{ S_0[i, j] -> [(i)] }]"
child:
schedule: "[N] -> L_1[{ S_0[i, j] -> [(j)] }]"
and when I try to delete "YOU ARE HERE" node, it says "can only delete node with a single child" (which kinda makes me want to ask a bonus bonus quesiont: how to delete a sequence node? I can think only about isl_schedule_node_cut which deletes the whole subtree)