This is an archive of the discontinued LLVM Phabricator instance.

[mlir-tblgen] Slightly improve the diagnostic message in pattern match
ClosedPublic

Authored by Chia-hungDuan on Jul 13 2021, 3:24 AM.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Jul 13 2021, 3:24 AM
Chia-hungDuan requested review of this revision.Jul 13 2021, 3:24 AM
jpienaar accepted this revision.Jul 15 2021, 4:50 PM
jpienaar added inline comments.
mlir/tools/mlir-tblgen/RewriterGen.cpp
262

Can you use /*matchStr=*/ ?

345

The message and comment above it is difficult to reconcile. Does that comment apply somewhere else?

This revision is now accepted and ready to land.Jul 15 2021, 4:50 PM
Chia-hungDuan marked an inline comment as done.

Addressed review comment

Chia-hungDuan added inline comments.Jul 16 2021, 12:33 AM
mlir/tools/mlir-tblgen/RewriterGen.cpp
345

After checked the history, the logic mentioned by the comment has been moved above in the llvm::dyn_cast_or_null(in this commit ac68637ba94d05f413b1b963950c300fb2f81a99), so this one can be removed.

Fix a bug that calling emitMatchCheck to do null check for the op who is
supposed to report that match failure, e.g.,

// This is invalid.
emitMatchCheck(op, /*matchStr=*/op, ...);

This revision was landed with ongoing or failed builds.Jul 18 2021, 6:22 PM
This revision was automatically updated to reflect the committed changes.