This is an archive of the discontinued LLVM Phabricator instance.

[mlir][capi] Add TypeID to MLIR C-API
ClosedPublic

Authored by trilorez on Sep 30 2021, 5:44 PM.

Details

Summary

Exposes mlir::TypeID to the C API as MlirTypeID along with various accessors
and helper functions.

Diff Detail

Event Timeline

trilorez created this revision.Sep 30 2021, 5:44 PM
trilorez requested review of this revision.Sep 30 2021, 5:44 PM

Can you add unit-tests for this?

I also wonder if the C API generator for dialects should expose a way to get the type id for each operations directly without having to create them, have you considered this as well?

Can you add unit-tests for this?

Yes, is mlir/test/CAPI/ir.c a good place to add them, or should I make a new file?

I also wonder if the C API generator for dialects should expose a way to get the type id for each operations directly without having to create them, have you considered this as well?

I was looking into a way to generate type id accessors, but wasn't aware that there was already a C API generator for dialects. Could you point me to where that is?

Can you add unit-tests for this?

Yes, is mlir/test/CAPI/ir.c a good place to add them, or should I make a new file?

It's probably fine there.

I also wonder if the C API generator for dialects should expose a way to get the type id for each operations directly without having to create them, have you considered this as well?

I was looking into a way to generate type id accessors, but wasn't aware that there was already a C API generator for dialects. Could you point me to where that is?

Forget about it, I got confused between -gen-python-op-bindings and -gen-pass-capi-xxxx...

trilorez updated this revision to Diff 376557.Oct 1 2021, 9:36 AM

Added unit tests for type id functions

mehdi_amini accepted this revision.Oct 1 2021, 10:25 AM
This revision is now accepted and ready to land.Oct 1 2021, 10:25 AM
This revision was automatically updated to reflect the committed changes.