forked from OSchip/llvm-project
ea64828a10
This commit refactors the expected form of native constraint and rewrite functions, and greatly reduces the necessary user complexity required when defining a native function. Namely, this commit adds in automatic processing of the necessary PDLValue glue code, and allows for users to define constraint/rewrite functions using the C++ types that they actually want to use. As an example, lets see a simple example rewrite defined today: ``` static void rewriteFn(PatternRewriter &rewriter, PDLResultList &results, ArrayRef<PDLValue> args) { ValueRange operandValues = args[0].cast<ValueRange>(); TypeRange typeValues = args[1].cast<TypeRange>(); ... // Create an operation at some point and pass it back to PDL. Operation *op = rewriter.create<SomeOp>(...); results.push_back(op); } ``` After this commit, that same rewrite could be defined as: ``` static Operation *rewriteFn(PatternRewriter &rewriter ValueRange operandValues, TypeRange typeValues) { ... // Create an operation at some point and pass it back to PDL. return rewriter.create<SomeOp>(...); } ``` Differential Revision: https://reviews.llvm.org/D122086 |
||
---|---|---|
.. | ||
Bindings | ||
Dialects | ||
Rationale | ||
Tools | ||
Tutorials | ||
includes/img | ||
AttributesAndTypes.md | ||
BufferDeallocationInternals.md | ||
Bufferization.md | ||
CAPI.md | ||
CMakeLists.txt | ||
Canonicalization.md | ||
DataLayout.md | ||
DebugActions.md | ||
DeclarativeRewrites.md | ||
Diagnostics.md | ||
DialectConversion.md | ||
Interfaces.md | ||
LangRef.md | ||
OpDefinitions.md | ||
PDLL.md | ||
PassManagement.md | ||
Passes.md | ||
PatternRewriter.md | ||
Quantization.md | ||
README.txt | ||
SPIRVToLLVMDialectConversion.md | ||
ShapeInference.md | ||
SymbolsAndSymbolTables.md | ||
TargetLLVMIR.md | ||
Traits.md | ||
doxygen-mainpage.dox | ||
doxygen.cfg.in |
README.txt
MLIR documentation ================== Please note mlir.llvm.org is where MLIR's rendered documentation is displayed. The viewing experience on GitHub or elsewhere may not match those of the website. For any changes please verify instead that they work on the main website first. See https://github.com/llvm/mlir-www for the website generation information.