This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Affine] Fix bug in Affine canonicalization
Needs RevisionPublic

Authored by philass on Nov 14 2022, 4:24 AM.

Details

Summary

Both lhs, and rhs need to be updated after binExpr has been updated.

The call to getAffineBinaryOpExpr, can call a function like simplifyFloorDiv. This function can change not only the binaryOp, but also the lhs and rhs of the AffineBinaryOp being constructed.

Diff Detail

Event Timeline

philass created this revision.Nov 14 2022, 4:24 AM
philass requested review of this revision.Nov 14 2022, 4:24 AM
ftynse requested changes to this revision.Nov 16 2022, 12:55 PM

Please add a test

This revision now requires changes to proceed.Nov 16 2022, 12:55 PM

I actually have this fix with a test case. I can send a patch.

bondhugula resigned from this revision.Dec 17 2022, 9:56 PM

Thanks bondhugula

I'll close this.