Skip to content

Commit 2e6848a

Browse files
unterumarmungdcaballe
authored andcommitted
[mlir][arith] Rename operations: maxfmaximumf, minfminimumf (llvm#65800)
This patch is part of a larger initiative aimed at fixing floating-point `max` and `min` operations in MLIR: https://discourse.llvm.org/t/rfc-fix-floating-point-max-and-min-operations-in-mlir/72671. This commit addresses Task 1.2 of the mentioned RFC. By renaming these operations, we align their names with LLVM intrinsics that have corresponding semantics.
1 parent 23be8fa commit 2e6848a

File tree

49 files changed

+171
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+171
-170
lines changed

flang/lib/Lower/OpenMP.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,11 +802,11 @@ createReductionDecl(fir::FirOpBuilder &builder, llvm::StringRef reductionOpName,
802802
Fortran::parser::Unwrap<Fortran::parser::Name>(procDesignator)}) {
803803
if (name->source == "max") {
804804
reductionOp =
805-
getReductionOperation<mlir::arith::MaxFOp, mlir::arith::MaxSIOp>(
805+
getReductionOperation<mlir::arith::MaximumFOp, mlir::arith::MaxSIOp>(
806806
builder, type, loc, op1, op2);
807807
} else if (name->source == "min") {
808808
reductionOp =
809-
getReductionOperation<mlir::arith::MinFOp, mlir::arith::MinSIOp>(
809+
getReductionOperation<mlir::arith::MinimumFOp, mlir::arith::MinSIOp>(
810810
builder, type, loc, op1, op2);
811811
} else if (name->source == "ior") {
812812
assert((type.isIntOrIndex()) && "only integer is expected");

flang/test/Lower/OpenMP/wsloop-reduction-max.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
!CHECK: omp.yield(%[[MINIMUM_VAL_F]] : f32)
77
!CHECK: combiner
88
!CHECK: ^bb0(%[[ARG0_F:.*]]: f32, %[[ARG1_F:.*]]: f32):
9-
!CHECK: %[[COMB_VAL_F:.*]] = arith.maxf %[[ARG0_F]], %[[ARG1_F]] {{.*}}: f32
9+
!CHECK: %[[COMB_VAL_F:.*]] = arith.maximumf %[[ARG0_F]], %[[ARG1_F]] {{.*}}: f32
1010
!CHECK: omp.yield(%[[COMB_VAL_F]] : f32)
1111

1212
!CHECK: omp.reduction.declare @[[MAX_DECLARE_I:.*]] : i32 init {

flang/test/Lower/OpenMP/wsloop-reduction-min.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
!CHECK: omp.yield(%[[MAXIMUM_VAL_F]] : f32)
77
!CHECK: combiner
88
!CHECK: ^bb0(%[[ARG0_F:.*]]: f32, %[[ARG1_F:.*]]: f32):
9-
!CHECK: %[[COMB_VAL_F:.*]] = arith.minf %[[ARG0_F]], %[[ARG1_F]] {{.*}}: f32
9+
!CHECK: %[[COMB_VAL_F:.*]] = arith.minimumf %[[ARG0_F]], %[[ARG1_F]] {{.*}}: f32
1010
!CHECK: omp.yield(%[[COMB_VAL_F]] : f32)
1111

1212
!CHECK: omp.reduction.declare @[[MIN_DECLARE_I:.*]] : i32 init {

mlir/include/mlir/Dialect/Arith/IR/ArithOps.td

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -832,16 +832,16 @@ def Arith_SubFOp : Arith_FloatBinaryOp<"subf"> {
832832
}
833833

834834
//===----------------------------------------------------------------------===//
835-
// MaxFOp
835+
// MaximumFOp
836836
//===----------------------------------------------------------------------===//
837837

838-
def Arith_MaxFOp : Arith_FloatBinaryOp<"maxf", [Commutative]> {
838+
def Arith_MaximumFOp : Arith_FloatBinaryOp<"maximumf", [Commutative]> {
839839
let summary = "floating-point maximum operation";
840840
let description = [{
841841
Syntax:
842842

843843
```
844-
operation ::= ssa-id `=` `arith.maxf` ssa-use `,` ssa-use `:` type
844+
operation ::= ssa-id `=` `arith.maximumf` ssa-use `,` ssa-use `:` type
845845
```
846846

847847
Returns the maximum of the two arguments, treating -0.0 as less than +0.0.
@@ -851,7 +851,7 @@ def Arith_MaxFOp : Arith_FloatBinaryOp<"maxf", [Commutative]> {
851851

852852
```mlir
853853
// Scalar floating-point maximum.
854-
%a = arith.maxf %b, %c : f64
854+
%a = arith.maximumf %b, %c : f64
855855
```
856856
}];
857857
let hasFolder = 1;
@@ -876,16 +876,16 @@ def Arith_MaxUIOp : Arith_TotalIntBinaryOp<"maxui", [Commutative]> {
876876
}
877877

878878
//===----------------------------------------------------------------------===//
879-
// MinFOp
879+
// MinimumFOp
880880
//===----------------------------------------------------------------------===//
881881

882-
def Arith_MinFOp : Arith_FloatBinaryOp<"minf", [Commutative]> {
882+
def Arith_MinimumFOp : Arith_FloatBinaryOp<"minimumf", [Commutative]> {
883883
let summary = "floating-point minimum operation";
884884
let description = [{
885885
Syntax:
886886

887887
```
888-
operation ::= ssa-id `=` `arith.minf` ssa-use `,` ssa-use `:` type
888+
operation ::= ssa-id `=` `arith.minimumf` ssa-use `,` ssa-use `:` type
889889
```
890890

891891
Returns the minimum of the two arguments, treating -0.0 as less than +0.0.
@@ -895,7 +895,7 @@ def Arith_MinFOp : Arith_FloatBinaryOp<"minf", [Commutative]> {
895895

896896
```mlir
897897
// Scalar floating-point minimum.
898-
%a = arith.minf %b, %c : f64
898+
%a = arith.minimumf %b, %c : f64
899899
```
900900
}];
901901
let hasFolder = 1;

mlir/lib/Conversion/ArithToLLVM/ArithToLLVM.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ using FPToSIOpLowering =
5454
VectorConvertToLLVMPattern<arith::FPToSIOp, LLVM::FPToSIOp>;
5555
using FPToUIOpLowering =
5656
VectorConvertToLLVMPattern<arith::FPToUIOp, LLVM::FPToUIOp>;
57-
using MaxFOpLowering =
58-
VectorConvertToLLVMPattern<arith::MaxFOp, LLVM::MaximumOp,
57+
using MaximumFOpLowering =
58+
VectorConvertToLLVMPattern<arith::MaximumFOp, LLVM::MaximumOp,
5959
arith::AttrConvertFastMathToLLVM>;
6060
using MaxSIOpLowering =
6161
VectorConvertToLLVMPattern<arith::MaxSIOp, LLVM::SMaxOp>;
6262
using MaxUIOpLowering =
6363
VectorConvertToLLVMPattern<arith::MaxUIOp, LLVM::UMaxOp>;
64-
using MinFOpLowering =
65-
VectorConvertToLLVMPattern<arith::MinFOp, LLVM::MinimumOp,
64+
using MinimumFOpLowering =
65+
VectorConvertToLLVMPattern<arith::MinimumFOp, LLVM::MinimumOp,
6666
arith::AttrConvertFastMathToLLVM>;
6767
using MinSIOpLowering =
6868
VectorConvertToLLVMPattern<arith::MinSIOp, LLVM::SMinOp>;
@@ -495,10 +495,10 @@ void mlir::arith::populateArithToLLVMConversionPatterns(
495495
FPToUIOpLowering,
496496
IndexCastOpSILowering,
497497
IndexCastOpUILowering,
498-
MaxFOpLowering,
498+
MaximumFOpLowering,
499499
MaxSIOpLowering,
500500
MaxUIOpLowering,
501-
MinFOpLowering,
501+
MinimumFOpLowering,
502502
MinSIOpLowering,
503503
MinUIOpLowering,
504504
MulFOpLowering,

mlir/lib/Conversion/ArithToSPIRV/ArithToSPIRV.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,12 +1039,13 @@ class SelectOpPattern final : public OpConversionPattern<arith::SelectOp> {
10391039
};
10401040

10411041
//===----------------------------------------------------------------------===//
1042-
// MaxFOp
1042+
// MinimumFOp, MaximumFOp
10431043
//===----------------------------------------------------------------------===//
10441044

1045-
/// Converts arith.maxf to spirv.GL.FMax or spirv.CL.fmax.
1045+
/// Converts arith.maximumf/minimumf to spirv.GL.FMax/FMin or
1046+
/// spirv.CL.fmax/fmin.
10461047
template <typename Op, typename SPIRVOp>
1047-
class MinMaxFOpPattern final : public OpConversionPattern<Op> {
1048+
class MinimumMaximumFOpPattern final : public OpConversionPattern<Op> {
10481049
public:
10491050
using OpConversionPattern<Op>::OpConversionPattern;
10501051
LogicalResult
@@ -1055,7 +1056,7 @@ class MinMaxFOpPattern final : public OpConversionPattern<Op> {
10551056
if (!dstType)
10561057
return getTypeConversionFailure(rewriter, op);
10571058

1058-
// arith.maxf/minf:
1059+
// arith.maximumf/minimumf:
10591060
// "if one of the arguments is NaN, then the result is also NaN."
10601061
// spirv.GL.FMax/FMin
10611062
// "which operand is the result is undefined if one of the operands
@@ -1135,15 +1136,15 @@ void mlir::arith::populateArithToSPIRVPatterns(
11351136
MulIExtendedOpPattern<arith::MulUIExtendedOp, spirv::UMulExtendedOp>,
11361137
SelectOpPattern,
11371138

1138-
MinMaxFOpPattern<arith::MaxFOp, spirv::GLFMaxOp>,
1139-
MinMaxFOpPattern<arith::MinFOp, spirv::GLFMinOp>,
1139+
MinimumMaximumFOpPattern<arith::MaximumFOp, spirv::GLFMaxOp>,
1140+
MinimumMaximumFOpPattern<arith::MinimumFOp, spirv::GLFMinOp>,
11401141
spirv::ElementwiseOpPattern<arith::MaxSIOp, spirv::GLSMaxOp>,
11411142
spirv::ElementwiseOpPattern<arith::MaxUIOp, spirv::GLUMaxOp>,
11421143
spirv::ElementwiseOpPattern<arith::MinSIOp, spirv::GLSMinOp>,
11431144
spirv::ElementwiseOpPattern<arith::MinUIOp, spirv::GLUMinOp>,
11441145

1145-
MinMaxFOpPattern<arith::MaxFOp, spirv::CLFMaxOp>,
1146-
MinMaxFOpPattern<arith::MinFOp, spirv::CLFMinOp>,
1146+
MinimumMaximumFOpPattern<arith::MaximumFOp, spirv::CLFMaxOp>,
1147+
MinimumMaximumFOpPattern<arith::MinimumFOp, spirv::CLFMinOp>,
11471148
spirv::ElementwiseOpPattern<arith::MaxSIOp, spirv::CLSMaxOp>,
11481149
spirv::ElementwiseOpPattern<arith::MaxUIOp, spirv::CLUMaxOp>,
11491150
spirv::ElementwiseOpPattern<arith::MinSIOp, spirv::CLSMinOp>,

mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ createLinalgBodyCalculationForElementwiseOp(Operation *op, ValueRange args,
344344

345345
// tosa::MaximumOp
346346
if (isa<tosa::MaximumOp>(op) && isa<FloatType>(elementTy)) {
347-
return rewriter.create<arith::MaxFOp>(loc, args[0], args[1]);
347+
return rewriter.create<arith::MaximumFOp>(loc, args[0], args[1]);
348348
}
349349

350350
if (isa<tosa::MaximumOp>(op) && elementTy.isSignlessInteger()) {
@@ -355,7 +355,7 @@ createLinalgBodyCalculationForElementwiseOp(Operation *op, ValueRange args,
355355

356356
// tosa::MinimumOp
357357
if (isa<tosa::MinimumOp>(op) && isa<FloatType>(elementTy)) {
358-
return rewriter.create<arith::MinFOp>(loc, args[0], args[1]);
358+
return rewriter.create<arith::MinimumFOp>(loc, args[0], args[1]);
359359
}
360360

361361
if (isa<tosa::MinimumOp>(op) && elementTy.isSignlessInteger()) {
@@ -931,7 +931,7 @@ static Value createLinalgBodyCalculationForReduceOp(Operation *op,
931931
}
932932

933933
if (isa<tosa::ReduceMinOp>(op) && isa<FloatType>(elementTy)) {
934-
return rewriter.create<arith::MinFOp>(loc, args[0], args[1]);
934+
return rewriter.create<arith::MinimumFOp>(loc, args[0], args[1]);
935935
}
936936

937937
if (isa<tosa::ReduceMinOp>(op) && isa<IntegerType>(elementTy)) {
@@ -941,7 +941,7 @@ static Value createLinalgBodyCalculationForReduceOp(Operation *op,
941941
}
942942

943943
if (isa<tosa::ReduceMaxOp>(op) && isa<FloatType>(elementTy)) {
944-
return rewriter.create<arith::MaxFOp>(loc, args[0], args[1]);
944+
return rewriter.create<arith::MaximumFOp>(loc, args[0], args[1]);
945945
}
946946

947947
if (isa<tosa::ReduceMaxOp>(op) && isa<IntegerType>(elementTy)) {

mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ convertElementwiseOpToMMA(Operation *op) {
226226
return gpu::MMAElementwiseOp::MULF;
227227
if (isa<arith::SubFOp>(op))
228228
return gpu::MMAElementwiseOp::SUBF;
229-
if (isa<arith::MaxFOp>(op))
229+
if (isa<arith::MaximumFOp>(op))
230230
return gpu::MMAElementwiseOp::MAXF;
231-
if (isa<arith::MinFOp>(op))
231+
if (isa<arith::MinimumFOp>(op))
232232
return gpu::MMAElementwiseOp::MINF;
233233
if (isa<arith::DivFOp>(op))
234234
return gpu::MMAElementwiseOp::DIVF;

mlir/lib/Dialect/AMDGPU/Transforms/EmulateAtomics.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ void mlir::amdgpu::populateAmdgpuEmulateAtomicsPatterns(
163163
target.addIllegalOp<RawBufferAtomicFmaxOp>();
164164
}
165165
}
166-
patterns
167-
.add<RawBufferAtomicByCasPattern<RawBufferAtomicFaddOp, arith::AddFOp>,
168-
RawBufferAtomicByCasPattern<RawBufferAtomicFmaxOp, arith::MaxFOp>>(
169-
patterns.getContext());
166+
patterns.add<
167+
RawBufferAtomicByCasPattern<RawBufferAtomicFaddOp, arith::AddFOp>,
168+
RawBufferAtomicByCasPattern<RawBufferAtomicFmaxOp, arith::MaximumFOp>>(
169+
patterns.getContext());
170170
}
171171

172172
void AmdgpuEmulateAtomicsPass::runOnOperation() {

mlir/lib/Dialect/Affine/Analysis/AffineAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ static Value getSupportedReduction(AffineForOp forOp, unsigned pos,
6060
.Case([](arith::AndIOp) { return arith::AtomicRMWKind::andi; })
6161
.Case([](arith::OrIOp) { return arith::AtomicRMWKind::ori; })
6262
.Case([](arith::MulIOp) { return arith::AtomicRMWKind::muli; })
63-
.Case([](arith::MinFOp) { return arith::AtomicRMWKind::minf; })
64-
.Case([](arith::MaxFOp) { return arith::AtomicRMWKind::maxf; })
63+
.Case([](arith::MinimumFOp) { return arith::AtomicRMWKind::minf; })
64+
.Case([](arith::MaximumFOp) { return arith::AtomicRMWKind::maxf; })
6565
.Case([](arith::MinSIOp) { return arith::AtomicRMWKind::mins; })
6666
.Case([](arith::MaxSIOp) { return arith::AtomicRMWKind::maxs; })
6767
.Case([](arith::MinUIOp) { return arith::AtomicRMWKind::minu; })

mlir/lib/Dialect/Arith/IR/ArithOps.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -923,10 +923,10 @@ OpFoldResult arith::SubFOp::fold(FoldAdaptor adaptor) {
923923
}
924924

925925
//===----------------------------------------------------------------------===//
926-
// MaxFOp
926+
// MaximumFOp
927927
//===----------------------------------------------------------------------===//
928928

929-
OpFoldResult arith::MaxFOp::fold(FoldAdaptor adaptor) {
929+
OpFoldResult arith::MaximumFOp::fold(FoldAdaptor adaptor) {
930930
// maxf(x,x) -> x
931931
if (getLhs() == getRhs())
932932
return getRhs();
@@ -991,10 +991,10 @@ OpFoldResult MaxUIOp::fold(FoldAdaptor adaptor) {
991991
}
992992

993993
//===----------------------------------------------------------------------===//
994-
// MinFOp
994+
// MinimumFOp
995995
//===----------------------------------------------------------------------===//
996996

997-
OpFoldResult arith::MinFOp::fold(FoldAdaptor adaptor) {
997+
OpFoldResult arith::MinimumFOp::fold(FoldAdaptor adaptor) {
998998
// minf(x,x) -> x
999999
if (getLhs() == getRhs())
10001000
return getRhs();
@@ -2426,8 +2426,8 @@ std::optional<TypedAttr> mlir::arith::getNeutralElement(Operation *op) {
24262426
// Floating-point operations.
24272427
.Case([](arith::AddFOp op) { return AtomicRMWKind::addf; })
24282428
.Case([](arith::MulFOp op) { return AtomicRMWKind::mulf; })
2429-
.Case([](arith::MaxFOp op) { return AtomicRMWKind::maxf; })
2430-
.Case([](arith::MinFOp op) { return AtomicRMWKind::minf; })
2429+
.Case([](arith::MaximumFOp op) { return AtomicRMWKind::maxf; })
2430+
.Case([](arith::MinimumFOp op) { return AtomicRMWKind::minf; })
24312431
// Integer operations.
24322432
.Case([](arith::AddIOp op) { return AtomicRMWKind::addi; })
24332433
.Case([](arith::OrIOp op) { return AtomicRMWKind::ori; })
@@ -2483,9 +2483,9 @@ Value mlir::arith::getReductionOp(AtomicRMWKind op, OpBuilder &builder,
24832483
case AtomicRMWKind::muli:
24842484
return builder.create<arith::MulIOp>(loc, lhs, rhs);
24852485
case AtomicRMWKind::maxf:
2486-
return builder.create<arith::MaxFOp>(loc, lhs, rhs);
2486+
return builder.create<arith::MaximumFOp>(loc, lhs, rhs);
24872487
case AtomicRMWKind::minf:
2488-
return builder.create<arith::MinFOp>(loc, lhs, rhs);
2488+
return builder.create<arith::MinimumFOp>(loc, lhs, rhs);
24892489
case AtomicRMWKind::maxs:
24902490
return builder.create<arith::MaxSIOp>(loc, lhs, rhs);
24912491
case AtomicRMWKind::mins:

mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ struct FloorDivSIOpConverter : public OpRewritePattern<arith::FloorDivSIOp> {
161161
};
162162

163163
template <typename OpTy, arith::CmpFPredicate pred>
164-
struct MaxMinFOpConverter : public OpRewritePattern<OpTy> {
164+
struct MaximumMinimumFOpConverter : public OpRewritePattern<OpTy> {
165165
public:
166166
using OpRewritePattern<OpTy>::OpRewritePattern;
167167

@@ -321,8 +321,8 @@ struct ArithExpandOpsPass
321321
arith::CeilDivSIOp,
322322
arith::CeilDivUIOp,
323323
arith::FloorDivSIOp,
324-
arith::MaxFOp,
325-
arith::MinFOp
324+
arith::MaximumFOp,
325+
arith::MinimumFOp
326326
>();
327327

328328
if (includeBf16) {
@@ -367,8 +367,8 @@ void mlir::arith::populateArithExpandOpsPatterns(RewritePatternSet &patterns) {
367367
populateCeilFloorDivExpandOpsPatterns(patterns);
368368
// clang-format off
369369
patterns.add<
370-
MaxMinFOpConverter<MaxFOp, arith::CmpFPredicate::UGT>,
371-
MaxMinFOpConverter<MinFOp, arith::CmpFPredicate::ULT>
370+
MaximumMinimumFOpConverter<MaximumFOp, arith::CmpFPredicate::UGT>,
371+
MaximumMinimumFOpConverter<MinimumFOp, arith::CmpFPredicate::ULT>
372372
>(patterns.getContext());
373373
// clang-format on
374374
}

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,22 +449,22 @@ class RegionBuilderHelper {
449449
case BinaryFn::max_signed:
450450
assert(!allComplex);
451451
if (allFloatingPoint)
452-
return builder.create<arith::MaxFOp>(arg0.getLoc(), arg0, arg1);
452+
return builder.create<arith::MaximumFOp>(arg0.getLoc(), arg0, arg1);
453453
return builder.create<arith::MaxSIOp>(arg0.getLoc(), arg0, arg1);
454454
case BinaryFn::min_signed:
455455
assert(!allComplex);
456456
if (allFloatingPoint)
457-
return builder.create<arith::MinFOp>(arg0.getLoc(), arg0, arg1);
457+
return builder.create<arith::MinimumFOp>(arg0.getLoc(), arg0, arg1);
458458
return builder.create<arith::MinSIOp>(arg0.getLoc(), arg0, arg1);
459459
case BinaryFn::max_unsigned:
460460
assert(!allComplex);
461461
if (allFloatingPoint)
462-
return builder.create<arith::MaxFOp>(arg0.getLoc(), arg0, arg1);
462+
return builder.create<arith::MaximumFOp>(arg0.getLoc(), arg0, arg1);
463463
return builder.create<arith::MaxUIOp>(arg0.getLoc(), arg0, arg1);
464464
case BinaryFn::min_unsigned:
465465
assert(!allComplex);
466466
if (allFloatingPoint)
467-
return builder.create<arith::MinFOp>(arg0.getLoc(), arg0, arg1);
467+
return builder.create<arith::MinimumFOp>(arg0.getLoc(), arg0, arg1);
468468
return builder.create<arith::MinUIOp>(arg0.getLoc(), arg0, arg1);
469469
}
470470
llvm_unreachable("unsupported binary function");
@@ -2504,8 +2504,8 @@ FailureOr<SmallVector<Value>> SoftmaxOp::decomposeOperation(OpBuilder &b) {
25042504
Value neutralForMaxFInit =
25052505
b.create<linalg::FillOp>(loc, Value{neutralForMaxF}, outputReduce)
25062506
.result();
2507-
Value max =
2508-
reduce<arith::MaxFOp>(b, loc, input, neutralForMaxFInit, reductionDim);
2507+
Value max = reduce<arith::MaximumFOp>(b, loc, input, neutralForMaxFInit,
2508+
reductionDim);
25092509

25102510
// Step 2: Subtract max from input and exponentiate.
25112511
Value numerator = buildSubAndExpOp(b, loc, input, max, output, reductionDim);

mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,10 @@ mlir::linalg::getCombinerOpKind(Operation *combinerOp) {
505505
.Case<arith::AndIOp>([&](auto op) { return CombiningKind::AND; })
506506
.Case<arith::MaxSIOp>([&](auto op) { return CombiningKind::MAXSI; })
507507
.Case<arith::MaxUIOp>([&](auto op) { return CombiningKind::MAXUI; })
508-
.Case<arith::MaxFOp>([&](auto op) { return CombiningKind::MAXF; })
508+
.Case<arith::MaximumFOp>([&](auto op) { return CombiningKind::MAXF; })
509509
.Case<arith::MinSIOp>([&](auto op) { return CombiningKind::MINSI; })
510510
.Case<arith::MinUIOp>([&](auto op) { return CombiningKind::MINUI; })
511-
.Case<arith::MinFOp>([&](auto op) { return CombiningKind::MINF; })
511+
.Case<arith::MinimumFOp>([&](auto op) { return CombiningKind::MINF; })
512512
.Case<arith::MulIOp, arith::MulFOp>(
513513
[&](auto op) { return CombiningKind::MUL; })
514514
.Case<arith::OrIOp>([&](auto op) { return CombiningKind::OR; })

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ struct GenSemiRingReduction : public OpRewritePattern<GenericOp> {
556556
auto red = cast<linalg::YieldOp>(op.getRegion().front().getTerminator())
557557
.getOperand(0)
558558
.getDefiningOp();
559-
if (!isa<arith::AndIOp, arith::MulIOp, arith::MulFOp, arith::MinFOp,
560-
arith::MinSIOp, arith::MinUIOp, arith::MaxFOp, arith::MaxSIOp,
559+
if (!isa<arith::AndIOp, arith::MulIOp, arith::MulFOp, arith::MinimumFOp,
560+
arith::MinSIOp, arith::MinUIOp, arith::MaximumFOp, arith::MaxSIOp,
561561
arith::MaxUIOp>(red))
562562
return failure();
563563
Value s0 = op.getBlock()->getArgument(0);

mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ mlir::tosa::condenseValues(const SmallVector<Value> &values) {
3333

3434
Value mlir::tosa::clampFloatHelper(Location loc, Value arg, Value min,
3535
Value max, OpBuilder &rewriter) {
36-
Value minValue = rewriter.create<arith::MinFOp>(loc, arg, max);
37-
return rewriter.create<arith::MaxFOp>(loc, minValue, min);
36+
Value minValue = rewriter.create<arith::MinimumFOp>(loc, arg, max);
37+
return rewriter.create<arith::MaximumFOp>(loc, minValue, min);
3838
}
3939

4040
Value mlir::tosa::clampIntHelper(Location loc, Value arg, Value min, Value max,

0 commit comments

Comments
 (0)