Skip to content

Commit

Permalink
Fix one example
Browse files Browse the repository at this point in the history
  • Loading branch information
math-fehr committed May 16, 2024
1 parent 15f0b63 commit c699e77
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/filecheck/pdl_to_irdl_check/add_commute.mlir
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
irdl.dialect @builtin {
irdl.type @index

irdl.type @integer_type {
%bitwidth = irdl.base "#int"
irdl.parameters(%bitwidth)
}

irdl.attribute @integer_attr {
%index = irdl.base @index
%integer = irdl.base @integer_type
%t = irdl.any_of(%index, %integer)
%value = irdl.any
irdl.parameters(%value, %t)
}
}

irdl.dialect @arith {
irdl.operation @constant {
// %value = irdl.base @builtin::@integer_attr
// irdl.attributes { "value" = %value}
%index = irdl.base @builtin::@index
%integer = irdl.base @builtin::@integer_type
%t = irdl.any_of(%index, %integer)
irdl.results(%t)
}

irdl.operation @addi {
%index = irdl.base @builtin::@index
%integer = irdl.base @builtin::@integer_type
%t = irdl.any_of(%index, %integer)
irdl.operands(%t, %t)
irdl.results(%t)
}
}

pdl.pattern @AddCommute : benefit(0) {
%t = pdl.type
%x = pdl.operand : %t
Expand Down

0 comments on commit c699e77

Please sign in to comment.