This is an archive of the discontinued LLVM Phabricator instance.

[mlir] ConversionTarget legality callbacks refactoring
ClosedPublic

Authored by Hardcode84 on Jul 6 2021, 9:27 AM.

Details

Summary
  • Get rid of Optional<std::function> as std::function already have a null state
  • Add private setLegalityCallback function to set legality callback for unknown ops
  • Get rid of unknownOpsDynamicallyLegal flag, use unknownLegalityFn state insted. This causes behavior change when user first calls markUnknownOpDynamicallyLegal with callback and then without but I am not sure is the original behavior was really a 'feature', or just oversignt in the original implementation.

Diff Detail

Event Timeline

Hardcode84 created this revision.Jul 6 2021, 9:27 AM
Hardcode84 requested review of this revision.Jul 6 2021, 9:27 AM
rriddle accepted this revision.Jul 22 2021, 11:02 AM

Sorry, I've been OOO for a while. Looks great, thanks!

This revision is now accepted and ready to land.Jul 22 2021, 11:02 AM
This revision was automatically updated to reflect the committed changes.