AnyDSL / thorin2

The Higher ORder INtermediate representation - next gen
https://anydsl.github.io/thorin2/
MIT License
46 stars 9 forks source link

Simpler loop from %affine.For #245

Closed leissa closed 1 year ago

leissa commented 1 year ago

This patch creates a much simpler and more straightforward loop in LowerFor for %affine.For. Previously, the loop was quite dependent on certain optimizations to happen. Otherwise, some funny things can end up in the backend.

Remark: We probably want to reduce this pass even further to just substitute %affine.For with an appropriate loop as I sketched in the comment. But rn, we can't quite do it, if the accumulator contains a mem.