Skip to content

Commit

Permalink
Add addBenefit for quantization pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Tombana committed Jun 20, 2024
1 parent 82a495c commit 0125bd4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ def HasOneUse : Constraint<CPred<"$0.hasOneUse()">>;

class ConstantValue<string val> : AttrConstraint<CPred<"IsConstantValue($_self, " # val # ")">>;

// This pattern has priority (addBenefit) over the more generic pattern below
def : Pat<(LQ_QuantizeOp
(TFL_GreaterEqualOp:$ge_op
$input,
(Arith_ConstantOp ConstantValue<"0.0f">))),
(LQ_QuantizeOp $input),
[(HasOneUse $ge_op)]>;
[(HasOneUse $ge_op)], [], (addBenefit 100)>;

def : Pat<(LQ_QuantizeOp
(TFL_GreaterEqualOp:$ge_op
Expand Down

0 comments on commit 0125bd4

Please sign in to comment.