Convert linalg to loops
convert_linalg_to_loops
LowerLinalgStructuredOpPattern
Bases: RewritePattern
Source code in xdsl/transforms/convert_linalg_to_loops.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
match_and_rewrite(op: linalg.abstract_ops.LinalgStructuredOperation, rewriter: PatternRewriter) -> None
Source code in xdsl/transforms/convert_linalg_to_loops.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
ConvertLinalgToLoopsPass
dataclass
Bases: ModulePass
Converts a linalg structured ops to perfectly nested loops.
Source code in xdsl/transforms/convert_linalg_to_loops.py
153 154 155 156 157 158 159 160 161 162 163 164 | |
name = 'convert-linalg-to-loops'
class-attribute
instance-attribute
apply(ctx: Context, op: ModuleOp) -> None
Source code in xdsl/transforms/convert_linalg_to_loops.py
160 161 162 163 164 | |
materialize_loop_bound(rewriter: PatternRewriter, insertion_point: InsertPoint, operand: SSAValue[MemRefType], dim_index: int, dim_size: int) -> SSAValue
Create the value used as one loop upper bound.
If the memref dimension is dynamic, use memref.dim.
If it is static, use an index constant.
Source code in xdsl/transforms/convert_linalg_to_loops.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
create_loop_bounds(rewriter: PatternRewriter, insertion_point: InsertPoint, op: linalg.abstract_ops.LinalgStructuredOperation) -> Sequence[SSAValue]
Build loop upper bounds for a linalg structured operation.
This lowering only supports buffer semantics, so bound sources must come from memref operands.
Source code in xdsl/transforms/convert_linalg_to_loops.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |