This revision takes advantage of the empty AffineMap to specify the
0-D edge case. This allows removing a bunch of annoying corner cases
that ended up impacting users of Linalg.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is awesome, but this is a breaking change to clients who had implemented the WAR. I can help fix the IREE changes.
ok since everyone seems to be onboard and pifon@ is integrate duty this week I'll coordinate with him.
Thanks for your quick turnaround!
I looked at this change a little bit deeper, and I am not sure this works. This seems to have an affine_map for scalars being () -> (). This seems odd. Isn't it better to have a scalar access be (i,j) -> (), or something like that.
That needs change to the AffineMap constructor above.
This seems to have an affine_map for scalars being () -> (). This seems odd. Isn't it better to have a scalar access be (i,j) -> (), or something like that.
Whatever we do for 0-D is a convention, we can chose the convention we want.
()->() did not require parser changes whereas (i, j) -> () does.
I went ahead and implemented those changes.
mlir/include/mlir/IR/AffineMap.h | ||
---|---|---|
49 ↗ | (On Diff #249358) | We could just go for for: static AffineMap get(unsigned dimCount, unsigned symCount, MLIRContext *context); In any case, please have context appear last to be consistent with everything else. |
mlir/lib/IR/AffineMap.cpp | ||
---|---|---|
367 | Good point, thanks Uday! |
Very cool to see this happen! This will allow me to pay off some engineering debt for vector.contract as well (where I was forced to use empty maps rather than (i,j) -> () maps).
Do we need these asserts? None of the other methods assert this.