This is an archive of the discontinued LLVM Phabricator instance.

[mlir] DialectConversion: fix OperationLegalizer::isIllegal result when legality callback returns None
ClosedPublic

Authored by Hardcode84 on Nov 5 2021, 5:04 AM.

Details

Summary

OperationLegalizer::isIllegal returns false if operation legality wasn't
registered by user and we expect same behaviour when dynamic legality
callback return None, but instead true was returned.

Diff Detail

Event Timeline

Hardcode84 created this revision.Nov 5 2021, 5:04 AM
Hardcode84 requested review of this revision.Nov 5 2021, 5:04 AM
Hardcode84 updated this revision to Diff 385044.Nov 5 2021, 5:31 AM

fix comment

rriddle accepted this revision.Nov 15 2021, 12:26 AM
rriddle added inline comments.
mlir/lib/Transforms/Utils/DialectConversion.cpp
3139–3143

Does this work?

This revision is now accepted and ready to land.Nov 15 2021, 12:26 AM
Hardcode84 added inline comments.Nov 15 2021, 2:52 AM
mlir/lib/Transforms/Utils/DialectConversion.cpp
3139–3143

This seems to work, but IMO this is confusing. Without knowing the context someone can try to do 'obvious' refactoring to return !info->legalityFn(op) which will break this code.