-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
transformations: (pdl) Different type matching between polymorphic an…
…d fixed case (#3405) Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
- Loading branch information
1 parent
f3414f3
commit c5a1c4e
Showing
4 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// RUN: xdsl-opt %s -p apply-pdl | filecheck %s | ||
|
||
%x = arith.constant 42: i32 | ||
%y = arith.constant 84: i64 | ||
|
||
pdl.pattern : benefit(1) { | ||
%in_type = pdl.type: i32 | ||
%value = pdl.attribute: %in_type | ||
%constant_op = pdl.operation "arith.constant" {"value" = %value} -> (%in_type: !pdl.type) | ||
pdl.rewrite %constant_op { | ||
pdl.erase %constant_op | ||
} | ||
} | ||
|
||
// CHECK: builtin.module { | ||
// CHECK-NEXT: %y = arith.constant 84 : i64 | ||
// CHECK-NEXT: pdl.pattern : benefit(1) { | ||
// CHECK-NEXT: %in_type = pdl.type : i32 | ||
// CHECK-NEXT: %value = pdl.attribute : %in_type | ||
// CHECK-NEXT: %constant_op = pdl.operation "arith.constant" {"value" = %value} -> (%in_type : !pdl.type) | ||
// CHECK-NEXT: pdl.rewrite %constant_op { | ||
// CHECK-NEXT: pdl.erase %constant_op | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: xdsl-opt %s -p apply-pdl | filecheck %s | ||
|
||
%x = arith.constant 42: i32 | ||
%y = arith.constant 84: i64 | ||
|
||
pdl.pattern : benefit(1) { | ||
%in_type = pdl.type | ||
%value = pdl.attribute | ||
%constant_op = pdl.operation "arith.constant" {"value" = %value} -> (%in_type: !pdl.type) | ||
pdl.rewrite %constant_op { | ||
pdl.erase %constant_op | ||
} | ||
} | ||
|
||
// CHECK: builtin.module { | ||
// CHECK-NEXT: pdl.pattern : benefit(1) { | ||
// CHECK-NEXT: %in_type = pdl.type | ||
// CHECK-NEXT: %value = pdl.attribute | ||
// CHECK-NEXT: %constant_op = pdl.operation "arith.constant" {"value" = %value} -> (%in_type : !pdl.type) | ||
// CHECK-NEXT: pdl.rewrite %constant_op { | ||
// CHECK-NEXT: pdl.erase %constant_op | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters