Page MenuHomePhabricator

[MLIR][LinAlg] Use AnyTypeOf for LinalgOperand for better error msg.
ClosedPublic

Authored by kumasento on Thu, Jul 23, 9:23 AM.

Details

Summary

Previously, LinalgOperand is defined with Type<Or<..,>>, which produces
not very readable error messages when it is not matched, e.g.,

'linalg.generic' op operand #0 must be anonymous_326, but got ....

It is simply because the description property is not properly set.

This diff switches to use AnyTypeOf for LinalgOperand, which automatically
generates a description based on the allowed types provided.

As a result, the error message now becomes:

'linalg.generic' op operand #0 must be ranked tensor of any type values or strided memref of any type values, but got ...

Which is clearer and more informative.

Diff Detail

Event Timeline

kumasento created this revision.Thu, Jul 23, 9:23 AM
kumasento retitled this revision from Use AnyTypeOf for LinalgOperand for better error msg. to [MLIR][LinAlg] Use AnyTypeOf for LinalgOperand for better error msg..Thu, Jul 23, 10:44 AM
nicolasvasilache accepted this revision.Wed, Jul 29, 6:12 AM

Much better, thanks @kumasento

This revision is now accepted and ready to land.Wed, Jul 29, 6:12 AM

Much better, thanks @kumasento

Thank you Nicolas, would you mind helping me committing it when you are available? Thanks :)