@@ -2362,7 +2362,7 @@ mlir::Value IntrinsicLibrary::genAcosd(mlir::Type resultType,
23622362 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
23632363 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
23642364 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 ));
23662366 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
23672367 mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
23682368 return getRuntimeCallGenerator (" acos" , ftype)(builder, loc, {arg});
@@ -2513,7 +2513,7 @@ mlir::Value IntrinsicLibrary::genAsind(mlir::Type resultType,
25132513 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
25142514 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
25152515 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 ));
25172517 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
25182518 mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
25192519 return getRuntimeCallGenerator (" asin" , ftype)(builder, loc, {arg});
@@ -2539,7 +2539,7 @@ mlir::Value IntrinsicLibrary::genAtand(mlir::Type resultType,
25392539 }
25402540 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
25412541 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);
25432543 mlir::Value factor = builder.createConvert (loc, resultType, dfactor);
25442544 return builder.create <mlir::arith::MulFOp>(loc, atan, factor);
25452545}
@@ -2564,7 +2564,7 @@ mlir::Value IntrinsicLibrary::genAtanpi(mlir::Type resultType,
25642564 }
25652565 llvm::APFloat inv_pi = llvm::APFloat (llvm::numbers::inv_pi);
25662566 mlir::Value dfactor =
2567- builder.createRealConstant (loc, mlir::FloatType::getF64 (context), inv_pi);
2567+ builder.createRealConstant (loc, mlir::Float64Type::get (context), inv_pi);
25682568 mlir::Value factor = builder.createConvert (loc, resultType, dfactor);
25692569 return builder.create <mlir::arith::MulFOp>(loc, atan, factor);
25702570}
@@ -3119,7 +3119,7 @@ mlir::Value IntrinsicLibrary::genCosd(mlir::Type resultType,
31193119 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
31203120 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
31213121 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 ));
31233123 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
31243124 mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
31253125 return getRuntimeCallGenerator (" cos" , ftype)(builder, loc, {arg});
@@ -4412,12 +4412,12 @@ IntrinsicLibrary::genIeeeCopySign(mlir::Type resultType,
44124412 mlir::FloatType yRealType =
44134413 mlir::dyn_cast<mlir::FloatType>(yRealVal.getType ());
44144414
4415- if (yRealType == mlir::FloatType::getBF16 (builder.getContext ())) {
4415+ if (yRealType == mlir::BFloat16Type::get (builder.getContext ())) {
44164416 // Workaround: CopySignOp and BitcastOp don't work for kind 3 arg Y.
44174417 // This conversion should always preserve the sign bit.
44184418 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 ());
44214421 }
44224422
44234423 // Args have the same type.
@@ -4940,7 +4940,7 @@ mlir::Value IntrinsicLibrary::genIeeeReal(mlir::Type resultType,
49404940
49414941 assert (args.size () == 2 );
49424942 mlir::Type i1Ty = builder.getI1Type ();
4943- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
4943+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
49444944 mlir::Value a = args[0 ];
49454945 mlir::Type aType = a.getType ();
49464946
@@ -5140,7 +5140,7 @@ mlir::Value IntrinsicLibrary::genIeeeRem(mlir::Type resultType,
51405140 mlir::Value x = args[0 ];
51415141 mlir::Value y = args[1 ];
51425142 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 ());
51445144 x = builder.create <fir::ConvertOp>(loc, f32Ty, x);
51455145 y = builder.create <fir::ConvertOp>(loc, f32Ty, y);
51465146 } else {
@@ -5174,7 +5174,7 @@ mlir::Value IntrinsicLibrary::genIeeeRint(mlir::Type resultType,
51745174 }
51755175 if (mlir::cast<mlir::FloatType>(resultType).getWidth () == 16 )
51765176 a = builder.create <fir::ConvertOp>(
5177- loc, mlir::FloatType::getF32 (builder.getContext ()), a);
5177+ loc, mlir::Float32Type::get (builder.getContext ()), a);
51785178 mlir::Value result = builder.create <fir::ConvertOp>(
51795179 loc, resultType, genRuntimeCall (" nearbyint" , a.getType (), a));
51805180 if (isStaticallyPresent (args[1 ])) {
@@ -5259,10 +5259,10 @@ mlir::Value IntrinsicLibrary::genIeeeSignbit(mlir::Type resultType,
52595259 mlir::Value realVal = args[0 ];
52605260 mlir::FloatType realType = mlir::dyn_cast<mlir::FloatType>(realVal.getType ());
52615261 int bitWidth = realType.getWidth ();
5262- if (realType == mlir::FloatType::getBF16 (builder.getContext ())) {
5262+ if (realType == mlir::BFloat16Type::get (builder.getContext ())) {
52635263 // Workaround: can't bitcast or convert real(3) to integer(2) or real(2).
52645264 realVal = builder.createConvert (
5265- loc, mlir::FloatType::getF32 (builder.getContext ()), realVal);
5265+ loc, mlir::Float32Type::get (builder.getContext ()), realVal);
52665266 bitWidth = 32 ;
52675267 }
52685268 mlir::Type intType = builder.getIntegerType (bitWidth);
@@ -6026,7 +6026,7 @@ mlir::Value IntrinsicLibrary::genModulo(mlir::Type resultType,
60266026 auto fastMathFlags = builder.getFastMathFlags ();
60276027 // F128 arith::RemFOp may be lowered to a runtime call that may be unsupported
60286028 // 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 ()) ||
60306030 (fastMathFlags & mlir::arith::FastMathFlags::ninf) ==
60316031 mlir::arith::FastMathFlags::none)
60326032 return builder.createConvert (
@@ -6215,7 +6215,7 @@ mlir::Value IntrinsicLibrary::genNearest(mlir::Type resultType,
62156215 mlir::FloatType yType = mlir::dyn_cast<mlir::FloatType>(args[1 ].getType ());
62166216 const unsigned yBitWidth = yType.getWidth ();
62176217 if (xType != yType) {
6218- mlir::Type f32Ty = mlir::FloatType::getF32 (builder.getContext ());
6218+ mlir::Type f32Ty = mlir::Float32Type::get (builder.getContext ());
62196219 if (xBitWidth < 32 )
62206220 x1 = builder.createConvert (loc, f32Ty, x1);
62216221 if (yBitWidth > 32 && yBitWidth > xBitWidth)
@@ -7166,7 +7166,7 @@ mlir::Value IntrinsicLibrary::genSind(mlir::Type resultType,
71667166 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
71677167 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
71687168 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 ));
71707170 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
71717171 mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
71727172 return getRuntimeCallGenerator (" sin" , ftype)(builder, loc, {arg});
@@ -7247,7 +7247,7 @@ mlir::Value IntrinsicLibrary::genTand(mlir::Type resultType,
72477247 mlir::FunctionType::get (context, {resultType}, {args[0 ].getType ()});
72487248 llvm::APFloat pi = llvm::APFloat (llvm::numbers::pi);
72497249 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 ));
72517251 mlir::Value factor = builder.createConvert (loc, args[0 ].getType (), dfactor);
72527252 mlir::Value arg = builder.create <mlir::arith::MulFOp>(loc, args[0 ], factor);
72537253 return getRuntimeCallGenerator (" tan" , ftype)(builder, loc, {arg});
0 commit comments