kumasento / polymer

Bridging polyhedral analysis tools to the MLIR framework
MIT License
99 stars 20 forks source link

Issues when sum reduction is the 2nd operand of min/max #46

Closed kumasento closed 3 years ago

kumasento commented 3 years ago

This is a tricky bug, if sum reduction appears to be the 2nd operand, this assertion will fail

https://github.com/kumasento/polymer/blob/f0c09de8ceae6a0d94680eae8ddc884ccddfa2cc/lib/Target/OpenScop/ConvertFromOpenScop.cc#L265-L266

Instead of checking there is one expr, we should check that there is only one expr newly added.

We should change which affExpr to update as well here -

https://github.com/kumasento/polymer/blob/f0c09de8ceae6a0d94680eae8ddc884ccddfa2cc/lib/Target/OpenScop/ConvertFromOpenScop.cc#L279-L280