forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ElementwiseOpFusion: option for disable empty (#430)
* ElementwiseOpFusion: option for disable empty --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com>
- Loading branch information
1 parent
992dad3
commit 5518042
Showing
4 changed files
with
27 additions
and
5 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
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
13 changes: 13 additions & 0 deletions
13
mlir/test/Dialect/Linalg/fusion-elementwise-ops-no-remove-outs-deps.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,13 @@ | ||
// RUN: mlir-opt %s -p 'builtin.module(func.func(linalg-fuse-elementwise-ops{remove-outs-dependency=0}))' -split-input-file | FileCheck %s | ||
|
||
#identity = affine_map<(d0) -> (d0)> | ||
|
||
func.func @keep_outs_dependency(%arg: tensor<4xf32>) -> tensor<4xf32> { | ||
// CHECK-NOT: tensor.empty | ||
%1 = linalg.generic {indexing_maps = [#identity, #identity], iterator_types = ["parallel"] } ins(%arg: tensor<4xf32>) outs(%arg: tensor<4xf32>) { | ||
^bb0(%in: f32, %out: f32): | ||
%exp = arith.negf %in: f32 | ||
linalg.yield %exp : f32 | ||
} -> tensor<4xf32> | ||
return %1 : tensor<4xf32> | ||
} |