Add minor doc improvements (#70984)

- Document legacy ops lowered by `convert-func-to-llvm` and link it to a
GH issue
- Document the need for bufferization before `convert-linalg-to-loops`
- Document the ops lowered by `expand-strided-metadata`.
This commit is contained in:
Jeremy Kun
2023-11-01 14:21:53 -07:00
committed by GitHub
parent cfb791aa4b
commit 7982bc340b
4 changed files with 21 additions and 1 deletions

View File

@@ -391,6 +391,10 @@ def ConvertFuncToLLVMPass : Pass<"convert-func-to-llvm", "ModuleOp"> {
1 value is returned, packed into an LLVM IR struct type. Function calls and
returns are updated accordingly. Block argument types are updated to use
LLVM IR types.
Note that until https://github.com/llvm/llvm-project/issues/70982 is resolved,
this pass includes patterns that lower `arith` and `cf` to LLVM. This is legacy
code due to when they were all converted in the same pass.
}];
let dependentDialects = ["LLVM::LLVMDialect"];
let options = [

View File

@@ -69,6 +69,13 @@ def LinalgLowerToAffineLoops : Pass<"convert-linalg-to-affine-loops"> {
def LinalgLowerToLoops : Pass<"convert-linalg-to-loops"> {
let summary = "Lower the operations from the linalg dialect into loops";
let description = [{
Lowers the `linalg` ops to loop nests using `scf.for`.
Pre-condition: the operands used by the `linalg` ops have buffer semantics,
i.e., tensor operands and results must be converted to memrefs via
bufferization.
}];
let constructor = "mlir::createConvertLinalgToLoopsPass()";
let dependentDialects = [
"linalg::LinalgDialect",

View File

@@ -196,6 +196,14 @@ def ExpandStridedMetadata : Pass<"expand-strided-metadata"> {
In particular, this pass transforms operations into explicit sequence of
operations that model the effect of this operation on the different metadata.
This pass uses affine constructs to materialize these effects.
Supported ops include:
- `memref.collapse_shape`
- `memref.expand_shape`
- `memref.extract_aligned_pointer_as_index`
- `memref.extract_strided_metadata`
- `memref.subview`
}];
let constructor = "mlir::memref::createExpandStridedMetadataPass()";
let dependentDialects = [

View File

@@ -804,7 +804,8 @@ struct ConvertFuncToLLVMPass
RewritePatternSet patterns(&getContext());
populateFuncToLLVMConversionPatterns(typeConverter, patterns, symbolTable);
// TODO: Remove these in favor of their dedicated conversion passes.
// TODO(https://github.com/llvm/llvm-project/issues/70982): Remove these in
// favor of their dedicated conversion passes.
arith::populateArithToLLVMConversionPatterns(typeConverter, patterns);
cf::populateControlFlowToLLVMConversionPatterns(typeConverter, patterns);