This is an archive of the discontinued LLVM Phabricator instance.

[mlir] add utilites for DiagnosedSilenceableFailure
ClosedPublic

Authored by ftynse on Oct 17 2022, 5:49 AM.

Details

Summary

This class adds helper functions similar to emitError for the
DiagnosedSilenceableFailure class in both the silenceable and definite
failure cases. These helpers simplify the use of said class and make
tranfsorm op application code idiomatic.

Diff Detail

Event Timeline

ftynse created this revision.Oct 17 2022, 5:49 AM
ftynse requested review of this revision.Oct 17 2022, 5:49 AM
Herald added a project: Restricted Project. · View Herald Transcript
springerm accepted this revision.Oct 17 2022, 6:54 AM

Nice, this will make the error handling much easier to use!

mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
186

Optional: To be consistent with op->emitError, this could take an Operation * or Value instead of Location.

266

nit: Without looking at the impl of DiagnosedSilenceableFailure: I expected something like DiagnosedSilenceableFailure(loc, message);, similar to emitDefiniteFailure.

This revision is now accepted and ready to land.Oct 17 2022, 6:54 AM
ftynse updated this revision to Diff 468217.Oct 17 2022, 8:29 AM
ftynse marked 2 inline comments as done.

Address review.

mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
266

There's no such constructor, it would be unclear in which state the silenceable failure is created.

This revision was landed with ongoing or failed builds.Oct 17 2022, 8:31 AM
This revision was automatically updated to reflect the committed changes.