This is an archive of the discontinued LLVM Phabricator instance.

[mlir][CAPI] Introduce standard source layout for mlir-c dialect registration.
ClosedPublic

Authored by stellaraccident on Jan 9 2021, 7:04 PM.

Details

Summary
  • Registers a small set of sample dialects.
  • NFC with respect to existing C-API symbols but some headers have been moved down a level to the Dialect/ sub-directory.
  • Adds an additional entry point per dialect that is needed for dynamic discovery/loading.
  • See discussion: https://llvm.discourse.group/t/dialects-and-the-c-api/2306/16

Diff Detail

Event Timeline

stellaraccident created this revision.Jan 9 2021, 7:04 PM
stellaraccident requested review of this revision.Jan 9 2021, 7:04 PM
GeorgeLyon accepted this revision.Jan 9 2021, 7:15 PM

It is great to see a unified approach to dialects, this will make further improvements much easier. Thanks, Stella!

This revision is now accepted and ready to land.Jan 9 2021, 7:15 PM
Harbormaster completed remote builds in B84600: Diff 315646.
mehdi_amini added inline comments.Jan 9 2021, 8:52 PM
mlir/include/mlir-c/Dialect/Linalg.h
26

Why isn't this all TableGen generated?

lattner accepted this revision.Jan 9 2021, 9:04 PM
lattner added a subscriber: lattner.

nice

stellaraccident added inline comments.Jan 9 2021, 9:19 PM
mlir/include/mlir-c/Dialect/Linalg.h
26

Because once George and I wrote it, we felt that tablegen would add a lot of complexity and opacity for no benefit.

ftynse accepted this revision.Jan 11 2021, 6:01 AM
mlir/lib/CAPI/Dialect/Tensor.cpp