Repository navigation
Add pattern to do affine.min canonicalization after tile and distribute - #5251
Conversation
49d8578 to
c4129e5
Compare
| /// With N a compile time constant. This operations can be replace by | ||
| /// `%cN = constant N : index` if we can prove that %lb, %step and %ub are | ||
| /// divisible by N. | ||
| struct AffineMinDistributedSCFCanonicalizationPattern |
There was a problem hiding this comment.
I'd rather not expose the struct directly, but rather use an "populateAffineMinSCFCanonicalizationPattern" method.
There was a problem hiding this comment.
Make sense, I moved the structure into the cpp file
0405342 to
4ba1158
Compare
| /// scf.for %iv = %lb to %ub step %step | ||
| /// %affine.min affine_map<(d0, d1) -> (N, d0 - d1)>(%ub, %iv) | ||
| /// ``` | ||
| static bool affineMinOpDivisible(AffineMinOp minOp, int64_t dividend) { |
There was a problem hiding this comment.
Nit about name: This sounds like the affine_min is divisible by tile size :) . If you cant think of anything better, I cant either.
There was a problem hiding this comment.
Well it does mean the result of the affine_min is divisible by tile size. We check that both side of the min are divisible to prove that the result is divisible. If it wasn't we couldn't do the transformation. Maybe I misunderstood your comment.
There was a problem hiding this comment.
Its a minor nit. I already approved. My read was that "affine min is divisible" which to me is a strange name. I didnt parse it the same as "result of affine min is divisible".
Like I said, very minor issue. You can ignore it if this makes no sense to you.
No description provided.