@@ -2362,7 +2362,7 @@ mlir::Value IntrinsicLibrary::genAcosd(mlir::Type resultType,
2362
2362
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
2363
2363
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
2364
2364
mlir::Value dfactor = builder.createRealConstant (
2365
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
2365
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
2366
2366
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
2367
2367
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
2368
2368
return getRuntimeCallGenerator (" acos" , ftype)(builder, loc, {arg});
@@ -2513,7 +2513,7 @@ mlir::Value IntrinsicLibrary::genAsind(mlir::Type resultType,
2513
2513
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
2514
2514
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
2515
2515
mlir::Value dfactor = builder.createRealConstant (
2516
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
2516
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
2517
2517
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
2518
2518
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
2519
2519
return getRuntimeCallGenerator (" asin" , ftype)(builder, loc, {arg});
@@ -2539,7 +2539,7 @@ mlir::Value IntrinsicLibrary::genAtand(mlir::Type resultType,
2539
2539
}
2540
2540
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
2541
2541
mlir::Value dfactor = builder.createRealConstant (
2542
- loc, mlir::FloatType::getF64 (context), llvm::APFloat (180.0 ) / pi);
2542
+ loc, mlir::Float64Type::get (context), llvm::APFloat (180.0 ) / pi);
2543
2543
mlir::Value factor = builder.createConvert (loc, resultType, dfactor);
2544
2544
return builder.create <mlir::arith::MulFOp>(loc, atan, factor);
2545
2545
}
@@ -2564,7 +2564,7 @@ mlir::Value IntrinsicLibrary::genAtanpi(mlir::Type resultType,
2564
2564
}
2565
2565
llvm::APFloat inv_pi = llvm::APFloat (llvm::numbers::inv_pi);
2566
2566
mlir::Value dfactor =
2567
- builder.createRealConstant (loc, mlir::FloatType::getF64 (context), inv_pi);
2567
+ builder.createRealConstant (loc, mlir::Float64Type::get (context), inv_pi);
2568
2568
mlir::Value factor = builder.createConvert (loc, resultType, dfactor);
2569
2569
return builder.create <mlir::arith::MulFOp>(loc, atan, factor);
2570
2570
}
@@ -3119,7 +3119,7 @@ mlir::Value IntrinsicLibrary::genCosd(mlir::Type resultType,
3119
3119
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
3120
3120
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
3121
3121
mlir::Value dfactor = builder.createRealConstant (
3122
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
3122
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
3123
3123
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
3124
3124
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
3125
3125
return getRuntimeCallGenerator (" cos" , ftype)(builder, loc, {arg});
@@ -4412,12 +4412,12 @@ IntrinsicLibrary::genIeeeCopySign(mlir::Type resultType,
4412
4412
mlir::FloatType yRealType =
4413
4413
mlir::dyn_cast<mlir::FloatType>(yRealVal.getType ());
4414
4414
4415
- if (yRealType == mlir::FloatType::getBF16 (builder.getContext ())) {
4415
+ if (yRealType == mlir::BFloat16Type::get (builder.getContext ())) {
4416
4416
// Workaround: CopySignOp and BitcastOp don't work for kind 3 arg Y.
4417
4417
// This conversion should always preserve the sign bit.
4418
4418
yRealVal = builder.createConvert (
4419
- loc, mlir::FloatType::getF32 (builder.getContext ()), yRealVal);
4420
- yRealType = mlir::FloatType::getF32 (builder.getContext ());
4419
+ loc, mlir::Float32Type::get (builder.getContext ()), yRealVal);
4420
+ yRealType = mlir::Float32Type::get (builder.getContext ());
4421
4421
}
4422
4422
4423
4423
// Args have the same type.
@@ -4940,7 +4940,7 @@ mlir::Value IntrinsicLibrary::genIeeeReal(mlir::Type resultType,
4940
4940
4941
4941
assert (args.size () == 2 );
4942
4942
mlir::Type i1Ty = builder.getI1Type ();
4943
- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
4943
+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
4944
4944
mlir::Value a = args[0 ];
4945
4945
mlir::Type aType = a.getType ();
4946
4946
@@ -5140,7 +5140,7 @@ mlir::Value IntrinsicLibrary::genIeeeRem(mlir::Type resultType,
5140
5140
mlir::Value x = args[0 ];
5141
5141
mlir::Value y = args[1 ];
5142
5142
if (mlir::dyn_cast<mlir::FloatType>(resultType).getWidth () < 32 ) {
5143
- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
5143
+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
5144
5144
x = builder.create <fir::ConvertOp>(loc, f32Ty, x);
5145
5145
y = builder.create <fir::ConvertOp>(loc, f32Ty, y);
5146
5146
} else {
@@ -5174,7 +5174,7 @@ mlir::Value IntrinsicLibrary::genIeeeRint(mlir::Type resultType,
5174
5174
}
5175
5175
if (mlir::cast<mlir::FloatType>(resultType).getWidth () == 16 )
5176
5176
a = builder.create <fir::ConvertOp>(
5177
- loc, mlir::FloatType::getF32 (builder.getContext ()), a);
5177
+ loc, mlir::Float32Type::get (builder.getContext ()), a);
5178
5178
mlir::Value result = builder.create <fir::ConvertOp>(
5179
5179
loc, resultType, genRuntimeCall (" nearbyint" , a.getType (), a));
5180
5180
if (isStaticallyPresent (args[1 ])) {
@@ -5259,10 +5259,10 @@ mlir::Value IntrinsicLibrary::genIeeeSignbit(mlir::Type resultType,
5259
5259
mlir::Value realVal = args[0 ];
5260
5260
mlir::FloatType realType = mlir::dyn_cast<mlir::FloatType>(realVal.getType ());
5261
5261
int bitWidth = realType.getWidth ();
5262
- if (realType == mlir::FloatType::getBF16 (builder.getContext ())) {
5262
+ if (realType == mlir::BFloat16Type::get (builder.getContext ())) {
5263
5263
// Workaround: can't bitcast or convert real(3) to integer(2) or real(2).
5264
5264
realVal = builder.createConvert (
5265
- loc, mlir::FloatType::getF32 (builder.getContext ()), realVal);
5265
+ loc, mlir::Float32Type::get (builder.getContext ()), realVal);
5266
5266
bitWidth = 32 ;
5267
5267
}
5268
5268
mlir::Type intType = builder.getIntegerType (bitWidth);
@@ -6026,7 +6026,7 @@ mlir::Value IntrinsicLibrary::genModulo(mlir::Type resultType,
6026
6026
auto fastMathFlags = builder.getFastMathFlags ();
6027
6027
// F128 arith::RemFOp may be lowered to a runtime call that may be unsupported
6028
6028
// on the target, so generate a call to Fortran Runtime's ModuloReal16.
6029
- if (resultType == mlir::FloatType::getF128 (builder.getContext ()) ||
6029
+ if (resultType == mlir::Float128Type::get (builder.getContext ()) ||
6030
6030
(fastMathFlags & mlir::arith::FastMathFlags::ninf) ==
6031
6031
mlir::arith::FastMathFlags::none)
6032
6032
return builder.createConvert (
@@ -6215,7 +6215,7 @@ mlir::Value IntrinsicLibrary::genNearest(mlir::Type resultType,
6215
6215
mlir::FloatType yType = mlir::dyn_cast<mlir::FloatType>(args[1 ].getType ());
6216
6216
const unsigned yBitWidth = yType.getWidth ();
6217
6217
if (xType != yType) {
6218
- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
6218
+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
6219
6219
if (xBitWidth < 32 )
6220
6220
x1 = builder.createConvert (loc, f32Ty, x1);
6221
6221
if (yBitWidth > 32 && yBitWidth > xBitWidth)
@@ -7166,7 +7166,7 @@ mlir::Value IntrinsicLibrary::genSind(mlir::Type resultType,
7166
7166
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
7167
7167
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
7168
7168
mlir::Value dfactor = builder.createRealConstant (
7169
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
7169
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
7170
7170
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
7171
7171
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
7172
7172
return getRuntimeCallGenerator (" sin" , ftype)(builder, loc, {arg});
@@ -7247,7 +7247,7 @@ mlir::Value IntrinsicLibrary::genTand(mlir::Type resultType,
7247
7247
mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
7248
7248
llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
7249
7249
mlir::Value dfactor = builder.createRealConstant (
7250
- loc, mlir::FloatType::getF64 (context), pi / llvm::APFloat (180.0 ));
7250
+ loc, mlir::Float64Type::get (context), pi / llvm::APFloat (180.0 ));
7251
7251
mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
7252
7252
mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
7253
7253
return getRuntimeCallGenerator (" tan" , ftype)(builder, loc, {arg});
0 commit comments