This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][Shape] Add error message to `cstr_broadcastable` operation
AbandonedPublic

Authored by frgossen on Jun 22 2021, 9:14 AM.

Details

Summary

Add error message to concretize the context in which the constraint fails.

Diff Detail

Event Timeline

frgossen created this revision.Jun 22 2021, 9:14 AM
frgossen requested review of this revision.Jun 22 2021, 9:14 AM
frgossen retitled this revision from BEGIN_PUBLIC [MLIR][Shape] Add error message to `cstr_broadcastable` operation to [MLIR][Shape] Add error message to `cstr_broadcastable` operation.Jun 22 2021, 9:14 AM
frgossen edited the summary of this revision. (Show Details)
jpienaar added inline comments.Jun 22 2021, 11:56 AM
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
847

If we made the default value "required broadcastable shapes", would that reduce the changes needed below?

851

This would seem to need an update?

frgossen added inline comments.Jun 23 2021, 12:53 AM
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
847

That's what I wanted but it causes problems with the variadic shapes. The builder functions are then often ambiguous, even in the generated code.

frgossen updated this revision to Diff 353892.Jun 23 2021, 2:04 AM

Address comments

frgossen marked 2 inline comments as done.Jun 23 2021, 2:05 AM
frgossen added inline comments.
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
847

Correction: The ambiguity derives not from the variadic shapes but from the default builders. When neither the message nor an attribute dict are passed there are two candidate function.

herhut accepted this revision.Jun 23 2021, 3:57 AM

+1 for the general direction. I agree a default would be useful, so that we do not need to pass a message when we do not care about the specific wording. If that requires fighting with the infra, lets land this for now.

frgossen abandoned this revision.Jun 24 2021, 7:10 AM