This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] LLVM dialect: modernize and cleanups
ClosedPublic

Authored by flaub on Jan 17 2020, 4:17 PM.

Details

Summary

Modernize some of the existing custom parsing code in the LLVM dialect.
While this reduces some boilerplate code, it also reduces the precision
of the diagnostic error messges.

Diff Detail

Event Timeline

flaub created this revision.Jan 17 2020, 4:17 PM
flaub added a comment.Jan 17 2020, 4:19 PM

I'm not sure this is a net-win because of the less effective error messages, but I thought I'd submit this and see what happens.

rriddle accepted this revision.Jan 17 2020, 4:22 PM
rriddle added inline comments.
mlir/test/Dialect/LLVMIR/invalid.mlir
203

Random note, it'd be nice to fix this error message to be a bit more helpful(not in this revision). We could likely use llvm::getTypeName<AttrT> inside of the parser to at least give the expected attribute class name.

This revision is now accepted and ready to land.Jan 17 2020, 4:22 PM

Unit tests: pass. 61987 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

I'm not sure this is a net-win because of the less effective error messages, but I thought I'd submit this and see what happens.

See my other comment. I think we can easily fixup the error messages to be more effective, by:
a) Using the attribute name in the message
b) Using llvm::getTypeName<> to print the c++ type of the expected attribute

flaub updated this revision to Diff 238930.Jan 17 2020, 4:44 PM
  • clang-format

Unit tests: pass. 61987 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

clang-format: pass.

Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

This revision was automatically updated to reflect the committed changes.