-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test case for
applyPatternsAndFoldGreedily
to support the rev…
…ert of 59bbc7a This shows that pushing constant to the right in a commutative op leads to `applyPatternsAndFoldGreedily` to converge without applying all the patterns. Differential Revision: https://reviews.llvm.org/D122870
- Loading branch information
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
mlir/test/Transforms/test-operation-folder-commutative.mlir
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,11 @@ | ||
// RUN: mlir-opt --pass-pipeline="func.func(test-patterns)" %s | FileCheck %s | ||
|
||
// CHECK-LABEL: func @test_reorder_constants_and_match | ||
func @test_reorder_constants_and_match(%arg0 : i32) -> (i32) { | ||
// CHECK: %[[CST:.+]] = arith.constant 43 | ||
%cst = arith.constant 43 : i32 | ||
// CHECK: return %[[CST]] | ||
%y = "test.op_commutative2"(%cst, %arg0) : (i32, i32) -> i32 | ||
%x = "test.op_commutative2"(%y, %arg0) : (i32, i32) -> i32 | ||
return %x : i32 | ||
} |
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