Arith
arith
¶
SignlessIntegerBinaryOperationZeroOrUnitRight
¶
Bases: RewritePattern
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.SignlessIntegerBinaryOperation, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
SignlessIntegerBinaryOperationConstantProp
¶
Bases: RewritePattern
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.SignlessIntegerBinaryOperation, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
FoldConstConstOp
¶
Bases: RewritePattern
Folds a floating point binary op whose operands are both arith.constants.
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.FloatingPointLikeBinaryOperation, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
FoldConstsByReassociation
¶
Bases: RewritePattern
Rewrites a chain of
(const1 <op> var) <op> const2
as
folded_const <op> val
The op must be associative and have the fastmath<reassoc> flag set.
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.AddfOp | arith.MulfOp, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
SelectConstPattern
¶
Bases: RewritePattern
arith.select %true %x %y = %x arith.select %false %x %y = %y
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.SelectOp, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
SelectTrueFalsePattern
¶
Bases: RewritePattern
arith.select %x %true %false = %x arith.select %x %false %true = %x xor 1
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.SelectOp, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
SelectSamePattern
¶
Bases: RewritePattern
arith.select %x %y %y = %y
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.SelectOp, rewriter: PatternRewriter)
¶
SelectFoldCmpfPattern
¶
Bases: RewritePattern
%1 = arith.cmpf ogt, %0, %cst fastmath
Source code in xdsl/transforms/canonicalization_patterns/arith.py
match_and_rewrite(op: arith.SelectOp, rewriter: PatternRewriter)
¶
Source code in xdsl/transforms/canonicalization_patterns/arith.py
ApplyCmpiPredicateToEqualOperands
¶
Bases: RewritePattern