Page MenuHomePhabricator

Added CallOpSignatureConversion pattern
AbandonedPublic

Authored by rsuderman on Feb 19 2020, 6:01 PM.

Details

Reviewers
rriddle
Summary

Added a corresponding conversion pattern for CallOp to match FuncOp. Currently
if just FuncOp is converted, CallOp is not correctly updated. This ensures CallOp
and FuncOp can have their types converted.

Diff Detail

Event Timeline

rsuderman created this revision.Feb 19 2020, 6:01 PM

Thanks for the patch Rob, this looks like it would be useful for many different users of CallOp!

Can we add a test for this?

mlir/include/mlir/Transforms/DialectConversion.h
369

Can we move this to a library specific to the StandardDialect? I'd like for us to keep DialectConversion as dialect agnostic as we can. I added FuncOp here because it's technically builtin(defined in IR/) at the moment.

mlir/lib/Transforms/DialectConversion.cpp
1780

Can we use operands here instead?

benvanik added inline comments.
mlir/lib/Transforms/DialectConversion.cpp
1780

+1 - operands must be used here

1781

the create and replace can be done together:

rewriter.replaceOpWithNewOp<CallOp>(callOp, callOp.callee(),
                                    convertedResults, operands);
rsuderman abandoned this revision.Mar 13 2020, 6:16 PM