diff --git a/flang/include/flang/Optimizer/Dialect/FIROps.td b/flang/include/flang/Optimizer/Dialect/FIROps.td --- a/flang/include/flang/Optimizer/Dialect/FIROps.td +++ b/flang/include/flang/Optimizer/Dialect/FIROps.td @@ -2425,18 +2425,6 @@ let printer = [{ return printUnaryOp(this->getOperation(), p); }]; } -class RealUnaryArithmeticOp traits = []> : - fir_UnaryArithmeticOp, - Arguments<(ins AnyRealLike:$operand)>; - -def fir_NegfOp : RealUnaryArithmeticOp<"negf">; - -class RealArithmeticOp traits = []> : - fir_ArithmeticOp, - Arguments<(ins AnyRealLike:$lhs, AnyRealLike:$rhs)>; - -def fir_ModfOp : RealArithmeticOp<"modf">; - def fir_ConstcOp : fir_Op<"constc", [NoSideEffect]> { let summary = "create a complex constant"; diff --git a/flang/lib/Lower/IntrinsicCall.cpp b/flang/lib/Lower/IntrinsicCall.cpp --- a/flang/lib/Lower/IntrinsicCall.cpp +++ b/flang/lib/Lower/IntrinsicCall.cpp @@ -1021,7 +1021,7 @@ auto imag = Fortran::lower::ComplexExprHelper{builder, loc}.extractComplexPart( cplx, /*isImagPart=*/true); - auto negImag = builder.create(loc, imag); + auto negImag = builder.create(loc, imag); return Fortran::lower::ComplexExprHelper{builder, loc}.insertComplexPart( cplx, negImag, /*isImagPart=*/true); } @@ -1187,7 +1187,7 @@ // TODO: Requirements when second argument is +0./0. auto zeroAttr = builder.getZeroAttr(resultType); auto zero = builder.create(loc, resultType, zeroAttr); - auto neg = builder.create(loc, abs); + auto neg = builder.create(loc, abs); auto cmp = builder.create(loc, mlir::CmpFPredicate::OLT, args[1], zero); return builder.create(loc, cmp, neg, abs); diff --git a/flang/test/Fir/fir-ops.fir b/flang/test/Fir/fir-ops.fir --- a/flang/test/Fir/fir-ops.fir +++ b/flang/test/Fir/fir-ops.fir @@ -491,23 +491,21 @@ // CHECK: [[VAL_171:%.*]] = constant 1.0 // CHECK: [[VAL_172:%.*]] = fir.convert [[VAL_171]] : (f32) -> f128 -// CHECK: [[VAL_173:%.*]] = fir.negf [[VAL_169]] : f128 +// CHECK: [[VAL_173:%.*]] = negf [[VAL_169]] : f128 // CHECK: [[VAL_174:%.*]] = addf [[VAL_172]], [[VAL_173]] : f128 // CHECK: [[VAL_175:%.*]] = subf [[VAL_174]], [[VAL_170]] : f128 // CHECK: [[VAL_176:%.*]] = mulf [[VAL_173]], [[VAL_175]] : f128 // CHECK: [[VAL_177:%.*]] = divf [[VAL_176]], [[VAL_169]] : f128 -// CHECK: [[VAL_178:%.*]] = fir.modf [[VAL_177]], [[VAL_170]] : f128 %c1 = constant 1.0 : f32 %0 = fir.convert %c1 : (f32) -> f128 - %1 = fir.negf %a : f128 + %1 = negf %a : f128 %2 = addf %0, %1 : f128 %3 = subf %2, %b : f128 %4 = mulf %1, %3 : f128 %5 = divf %4, %a : f128 - %6 = fir.modf %5, %b : f128 -// CHECK: return [[VAL_178]] : f128 +// CHECK: return [[VAL_177]] : f128 // CHECK: } - return %6 : f128 + return %5 : f128 } // CHECK-LABEL: func @arith_complex(