Page MenuHomePhabricator

Add an optional dialect_registration callback for "translations" registered with mlir-translate
ClosedPublic

Authored by mehdi_amini on Aug 22 2020, 3:11 PM.

Details

Summary

This will allow out-of-tree translation to register the dialects they expect
to see in their input, on the model of getDependentDialects() for passes.

Diff Detail

Event Timeline

mehdi_amini created this revision.Aug 22 2020, 3:11 PM
mehdi_amini requested review of this revision.Aug 22 2020, 3:11 PM

Minor tweak

Jing accepted this revision.Aug 22 2020, 5:12 PM
This revision is now accepted and ready to land.Aug 22 2020, 5:12 PM
rriddle accepted this revision.Aug 22 2020, 5:16 PM
rriddle added inline comments.
mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
124

Why is this needed?

mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp
117

Did you ever add the variadic template variant?

mehdi_amini marked 2 inline comments as done.

address comments

This revision was landed with ongoing or failed builds.Aug 22 2020, 6:02 PM
This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.Aug 22 2020, 6:06 PM
mlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
124

It is registered as a TranslateRegistration and not a TranslateFromMLIRRegistration

The contract is different as this function is doing the parsing itself instead of getting a Module as input.

I just pushed https://github.com/llvm/llvm-project/commit/12541b5ed59d and I'll update this patch to align this translation on the others.

mlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp
117

Yes, updated here (and everywhere)