This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Better message for FuncOp type mismatch
ClosedPublic

Authored by stephenneuendorffer on Sep 25 2020, 9:29 AM.

Details

Summary

Previously the actual types were not shown, which makes the message
difficult to grok in the context of long lowering chains. Also, it
appears that there were no actual tests for this.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2020, 9:29 AM
stephenneuendorffer requested review of this revision.Sep 25 2020, 9:29 AM
stephenneuendorffer edited the summary of this revision. (Show Details)

Should we do the same for result types as well?

Should we do the same for result types as well?

Probably. It looks like theres alot of overlap between std::call and spirv::call and probably others. I suspect that all the 'FunctionLike' checking should be factored out.

Agreed. I was initially going to suggest CallOpInterface (for the operand type checking) to cover even more cases, but realized that for CallOpInterface does not guaranteed that operand and callee argument type will be same, so that's not the place. We can actually factor out a checker to check that the given 2 type ranges are identical (same number and same types) and use that for operand & result checks for CallOp and other places as well.

I'll land this. @jurahul are you able to look at the refactoring part?

This revision was not accepted when it landed; it landed in state Needs Review.Oct 2 2020, 9:32 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.