This is an archive of the discontinued LLVM Phabricator instance.

[mlir][OpDSL] Separate `ReduceFn` and `ReduceFnUse`.
ClosedPublic

Authored by gysit on Dec 7 2021, 4:51 AM.

Details

Summary

The revision distinguishes ReduceFn and ReduceFnUse. The latter has the reduction dimensions attached while the former specifies the arithmetic function only. This separation allows us to adapt the reduction syntax a little bit and specify the reduction dimensions using square brackets (in contrast to the round brackets used for the values to reduce). It als is a preparation to add reduction function attributes to OpDSL. A reduction function attribute shall only specify the arithmetic function and not the reduction dimensions.

Example:

ReduceFn.max_unsigned(D.kh, D.kw)(...)

changes to:

ReduceFn.max_unsigned[D.kh, D.kw](...)

Depends On D115240

Diff Detail

Event Timeline

gysit created this revision.Dec 7 2021, 4:51 AM
gysit requested review of this revision.Dec 7 2021, 4:51 AM
gysit updated this revision to Diff 392363.Dec 7 2021, 5:08 AM

Remove debug print statement.

gysit updated this revision to Diff 393984.Dec 13 2021, 11:48 AM

Improve doc.

stellaraccident accepted this revision.Jan 4 2022, 10:13 AM

Nice improvement - thanks! (and sorry for review latency)

This revision is now accepted and ready to land.Jan 4 2022, 10:13 AM
This revision was automatically updated to reflect the committed changes.