Scf
scf
¶
RehoistConstInLoops
¶
Bases: RewritePattern
Carry out const definitions from the loops. In the future this will probably be done by the pattern rewriter itself, like it's done in the MLIR's applyPatternsAndFoldGreedily.
Source code in xdsl/transforms/canonicalization_patterns/scf.py
match_and_rewrite(op: scf.ForOp, rewriter: PatternRewriter) -> None
¶
Source code in xdsl/transforms/canonicalization_patterns/scf.py
SimplifyTrivialLoops
¶
Bases: RewritePattern
Rewriting pattern that erases loops that are known not to iterate, replaces single-iteration loops with their bodies, and removes empty loops that iterate at least once and only return values defined outside of the loop.
Source code in xdsl/transforms/canonicalization_patterns/scf.py
match_and_rewrite(op: scf.ForOp, rewriter: PatternRewriter) -> None
¶
Source code in xdsl/transforms/canonicalization_patterns/scf.py
IfPropagateConstantCondition
¶
Bases: RewritePattern
Source code in xdsl/transforms/canonicalization_patterns/scf.py
match_and_rewrite(op: scf.IfOp, rewriter: PatternRewriter) -> None
¶
Source code in xdsl/transforms/canonicalization_patterns/scf.py
SingleBlockExecuteInliner
¶
Bases: RewritePattern
Source code in xdsl/transforms/canonicalization_patterns/scf.py
match_and_rewrite(op: scf.ExecuteRegionOp, rewriter: PatternRewriter) -> None
¶
Source code in xdsl/transforms/canonicalization_patterns/scf.py
replace_op_with_region(rewriter: PatternRewriter, op: Operation, region: Region, args: Sequence[SSAValue] = ())
¶
Replaces the given op with the contents of the given single-block region, using the operands of the block terminator to replace operation results.
:raises ValueError: if the region does not have a single block.