loopy
loopy copied to clipboard
[Enhancement] Transformation to hoist terms in a reduction that are sound due to the distributive property
A desirable test case for this would be:
out[x, e, i] = sum([r, j], sum([j], Jac[x, e, r] * Rdiff[r, i, j] * u[e, j]))
should be transformed to
out[x, e, i] = sum([r, j], Jac[x, e, r] * sum([j], Rdiff[r, i, j] * u[e, j]))
A similar realization can occur for any reduction containing LogicalOr nodes.
(Was suggested by @inducer in a personal chat)