From c699e77864f4a0ba38ab8a23d70dee7da75ad928 Mon Sep 17 00:00:00 2001 From: Mathieu Fehr Date: Thu, 16 May 2024 01:24:50 +0100 Subject: [PATCH] Fix one example --- .../pdl_to_irdl_check/add_commute.mlir | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/filecheck/pdl_to_irdl_check/add_commute.mlir b/tests/filecheck/pdl_to_irdl_check/add_commute.mlir index 78f011d..a52d9e8 100644 --- a/tests/filecheck/pdl_to_irdl_check/add_commute.mlir +++ b/tests/filecheck/pdl_to_irdl_check/add_commute.mlir @@ -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