Skip to content

Commit

Permalink
[NFCI] Update constant matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
darthscsi committed Nov 4, 2022
1 parent 21905ca commit 11a95bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/circt/Dialect/FIRRTL/FIRRTLCanonicalization.td
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@

include "circt/Dialect/FIRRTL/FIRRTL.td"

/// Constraint that matches a ConstantOp, SpecialConstantOp, or InvalidValueOp.
/// Constraint that matches a ConstantOp, SpecialConstantOp, AggregateConstantOp, or InvalidValueOp.
def AnyConstantOp : Constraint<CPred<[{
isa_and_nonnull<ConstantOp, SpecialConstantOp, InvalidValueOp>
isa_and_nonnull<ConstantOp, SpecialConstantOp, InvalidValueOp, AggregateConstantOp>
($0.getDefiningOp())
}]>>;

/// Constraint that matches non-constant operations. Used to ensure that the
/// const-on-LHS rewriting patterns converge in case both operands are constant.
def NonConstantOp : Constraint<CPred<[{
!isa_and_nonnull<ConstantOp, SpecialConstantOp, InvalidValueOp>
!isa_and_nonnull<ConstantOp, SpecialConstantOp, InvalidValueOp, AggregateConstantOp>
($0.getDefiningOp())
}]>>;

Expand Down

0 comments on commit 11a95bf

Please sign in to comment.