[all-commits] [llvm/llvm-project] 52586c: [mlir][CAPI] Add result type inference to the CAPI.
Stella Laurenzo via All-commits
all-commits at lists.llvm.org
Sat Jan 23 14:33:38 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 52586c46b0883600a332fd64731dc5287981f980
https://github.com/llvm/llvm-project/commit/52586c46b0883600a332fd64731dc5287981f980
Author: Stella Laurenzo <stellaraccident at gmail.com>
Date: 2021-01-23 (Sat, 23 Jan 2021)
Changed paths:
M mlir/include/mlir-c/IR.h
M mlir/lib/CAPI/IR/IR.cpp
M mlir/test/CAPI/ir.c
Log Message:
-----------
[mlir][CAPI] Add result type inference to the CAPI.
* Adds a flag to MlirOperationState to enable result type inference using the InferTypeOpInterface.
* I chose this level of implementation for a couple of reasons:
a) In the creation flow is naturally where generated and custom builder code will be invoking such a thing
b) it is a bit more efficient to share the data structure and unpacking vs having a standalone entry-point
c) we can always decide to expose more of these interfaces with first-class APIs, but that doesn't preclude that we will always want to use this one in this way (and less API surface area for common things is better for API stability and evolution).
* I struggled to find an appropriate way to test it since we don't link the test dialect into anything CAPI accessible at present. I opted instead for one of the simplest ops I found in a regular dialect which implements the interface.
* This does not do any trait-based type selection. That will be left to generated tablegen wrappers.
Differential Revision: https://reviews.llvm.org/D95283
More information about the All-commits
mailing list