File tree Expand file tree Collapse file tree 3 files changed +0
-44
lines changed
include/mlir/Dialect/Tosa/IR Expand file tree Collapse file tree 3 files changed +0
-44
lines changed Original file line number Diff line number Diff line change @@ -1331,8 +1331,6 @@ def Tosa_ExpOp : Tosa_ElementwiseUnaryOp<"exp"> {
1331
1331
Extension<[Tosa_EXT_BF16]>,
1332
1332
];
1333
1333
1334
- let hasFolder = 1;
1335
-
1336
1334
let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";
1337
1335
}
1338
1336
@@ -1385,8 +1383,6 @@ def Tosa_LogOp : Tosa_ElementwiseUnaryOp<"log"> {
1385
1383
Extension<[Tosa_EXT_BF16]>,
1386
1384
];
1387
1385
1388
- let hasFolder = 1;
1389
-
1390
1386
let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";
1391
1387
}
1392
1388
Original file line number Diff line number Diff line change @@ -1562,26 +1562,6 @@ OpFoldResult TransposeOp::fold(FoldAdaptor adaptor) {
1562
1562
return getInput1 ();
1563
1563
}
1564
1564
1565
- OpFoldResult tosa::LogOp::fold (FoldAdaptor adaptor) {
1566
- auto input = getInput1 ();
1567
- // Element-wise log(exp(x)) = x
1568
- if (auto op = input.getDefiningOp <tosa::ExpOp>()) {
1569
- return op.getInput1 ();
1570
- }
1571
-
1572
- return {};
1573
- }
1574
-
1575
- OpFoldResult tosa::ExpOp::fold (FoldAdaptor adaptor) {
1576
- auto input = getInput1 ();
1577
- // Element-wise exp(log(x)) = x
1578
- if (auto op = input.getDefiningOp <tosa::LogOp>()) {
1579
- return op.getInput1 ();
1580
- }
1581
-
1582
- return {};
1583
- }
1584
-
1585
1565
OpFoldResult tosa::NegateOp::fold (FoldAdaptor adaptor) {
1586
1566
// Element-wise negate(negate(x)) = x
1587
1567
// iff all zero points are constant 0
Original file line number Diff line number Diff line change @@ -1104,26 +1104,6 @@ func.func @canonicalize_pad_slice_dynamic_noupdate(%arg0: tensor<1x16x?x3xf32>)
1104
1104
1105
1105
// -----
1106
1106
1107
- // CHECK-LABEL: @fold_log_exp
1108
- func.func @fold_log_exp (%arg0: tensor <?x1 xf32 >) -> tensor <?x1 xf32 > {
1109
- // CHECK: return %arg{{.*}} : tensor<?x1xf32>
1110
- %0 = tosa.exp %arg0 : (tensor <?x1 xf32 >) -> tensor <?x1 xf32 >
1111
- %1 = tosa.log %0 : (tensor <?x1 xf32 >) -> tensor <?x1 xf32 >
1112
- return %1 : tensor <?x1 xf32 >
1113
- }
1114
-
1115
- // -----
1116
-
1117
- // CHECK-LABEL: @fold_exp_log
1118
- func.func @fold_exp_log (%arg0: tensor <?x1 xf32 >) -> tensor <?x1 xf32 > {
1119
- // CHECK: return %arg{{.*}} : tensor<?x1xf32>
1120
- %0 = tosa.log %arg0 : (tensor <?x1 xf32 >) -> tensor <?x1 xf32 >
1121
- %1 = tosa.exp %0 : (tensor <?x1 xf32 >) -> tensor <?x1 xf32 >
1122
- return %1 : tensor <?x1 xf32 >
1123
- }
1124
-
1125
- // -----
1126
-
1127
1107
// CHECK-LABEL: @fold_negate_negate
1128
1108
func.func @fold_negate_negate (%arg0: tensor <?x1 xf32 >) -> tensor <?x1 xf32 > {
1129
1109
// CHECK: return %arg{{.*}} : tensor<?x1xf32>
You can’t perform that action at this time.
0 commit comments