Open naoyam opened 2 weeks ago
Can't you also have cycles in the ValGraph with reshape?
tv0 // [ iS0{12} ]
tv1 = reshape(tv0, {4, 3}) // [ iS1{4}, iS2{3} ]
tv2 = reshape(tv1, {12}) // [ iS3{12} ]
tv3 = add(tv0, tv2) // [ iS4{12} ]
IDs {0, 3, 4} are exact mapped, and there's a split from that to {1} and {2} and a merge back.
That is true too. It's just we haven't been hit by actual use cases (yet...).
Example (same as #3068):
The exact graph groups
i0
,i1
,i2
,i4
andi5
together as they are just used together with the pointwise ops. As you can see in the above diagram, this results in a cycle between the two groups.Being acyclic is one of the basic assumptions we have in the loop promotion analysis. For example,
ValGraphStmtSort
won't work with cyclic graphs, which means, for example,computeCoveredGroups
wont't work since it relies onValGraphStmtSort
. The propagation of promotion info through the IEL graph (intersection of exact and loop graphs) is also done withValGraphStmtSort
, so that may not work either, although IEL might not necessarily be cyclic even when the exact graph is cyclic.