forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing expansion patterns for
math.powf
(iree-org#14614)
Following the same approach as for other math ops. This will prevent the powf operation to be scalarized on CPU. Fixes iree-org#13547
- Loading branch information
Showing
2 changed files
with
12 additions
and
2 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
13 changes: 11 additions & 2 deletions
13
compiler/src/iree/compiler/Codegen/Common/test/polynomial_approximation.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 |
---|---|---|
@@ -1,8 +1,17 @@ | ||
// RUN: iree-opt --iree-codegen-polynomial-approximation %s | FileCheck %s | ||
// RUN: iree-opt --iree-codegen-polynomial-approximation --split-input-file %s | FileCheck %s | ||
|
||
// CHECK-LABEL: @polynomial_tan | ||
func.func @polynomial_tan(%arg0: f32) -> f32 { | ||
// CHECK-NOT: math.tan | ||
%0 = math.tan %arg0 : f32 | ||
%0 = math.tan %arg0 : f32 | ||
return %0 : f32 | ||
} | ||
|
||
// ----- | ||
|
||
// CHECK-LABEL: @expanded_pow | ||
func.func @expanded_pow(%arg0: f32, %arg1: f32) -> f32 { | ||
// CHECK-NOT: math.pow | ||
%0 = math.powf %arg0, %arg1 : f32 | ||
return %0 : f32 | ||
} |