forked from OSchip/llvm-project
9eb3e564d3
Implement Bug 46698, making ODS synthesize a getType() method that returns a specific C++ class for OneResult methods where we know that class. This eliminates a common source of casts in things like: myOp.getType().cast<FIRRTLType>().getPassive() because we know that myOp always returns a FIRRTLType. This also encourages op authors to type their results more tightly (which is also good for verification). I chose to implement this by splitting the OneResult trait into itself plus a OneTypedResult trait, given that many things are using `hasTrait<OneResult>` to conditionalize various logic. While this changes makes many many ops get more specific getType() results, it is generally drop-in compatible with the previous behavior because 'x.cast<T>()' is allowed when x is already known to be a T. The one exception to this is that we need declarations of the types used by ops, which is why a couple headers needed additional #includes. I updated a few things in tree to remove the now-redundant `.cast<>`'s, but there are probably many more than can be removed. Differential Revision: https://reviews.llvm.org/D93790 |
||
---|---|---|
.. | ||
Bindings | ||
Dialects | ||
Rationale | ||
Tutorials | ||
includes/img | ||
Bufferization.md | ||
CAPI.md | ||
CMakeLists.txt | ||
Canonicalization.md | ||
ConversionToLLVMDialect.md | ||
DeclarativeRewrites.md | ||
Diagnostics.md | ||
DialectConversion.md | ||
EDSC.md | ||
Interfaces.md | ||
LLVMDialectMemRefConvention.md | ||
LangRef.md | ||
OpDefinitions.md | ||
PassManagement.md | ||
Passes.md | ||
PatternRewriter.md | ||
Quantization.md | ||
README.txt | ||
SPIRVToLLVMDialectConversion.md | ||
ShapeInference.md | ||
SymbolsAndSymbolTables.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.