Page MenuHomePhabricator

[mlir-tblgen] Support binding multi-results of NativeCodeCall
Needs ReviewPublic

Authored by Chia-hungDuan on May 10 2021, 3:40 AM.

Details

Summary

We are able to bind NativeCodeCall result as binding operation. To make
table-gen have better understanding in the form of helper function,
we need to specify the number of return values in the NativeCodeCall
template. A VoidNativeCodeCall is added for void case.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.May 10 2021, 3:40 AM
Chia-hungDuan requested review of this revision.May 10 2021, 3:40 AM

Nice, thanks, small nits.

mlir/lib/TableGen/Pattern.cpp
339

How about

std::string repl = formatv(...);

? Then you don't need the std::string cast below (same in the other site below which looks identical below - should these always be the same and if so should we use helper?)

449

I think .str() is not needed as you assign directly to a variable of type std::string

mlir/test/lib/Dialect/Test/TestPatterns.cpp
49

How about flipping the order here to ensure that this is called?

mlir/tools/mlir-tblgen/RewriterGen.cpp
948–949

Could you expand here as to what is the incorrect form and how it is captured?

955

This should not be needed as varName is of type std::string

Chia-hungDuan marked 3 inline comments as done.

Addressed the review comments