@@ -378,8 +378,8 @@ static Value *MakeCpAsync(unsigned IntrinsicID, unsigned IntrinsicIDS,
378378static bool EnsureNativeHalfSupport (unsigned BuiltinID, const CallExpr *E,
379379 CodeGenFunction &CGF) {
380380 auto &C = CGF.CGM .getContext ();
381- if (!( C.getLangOpts ().NativeHalfType ||
382- ! C.getTargetInfo ().useFP16ConversionIntrinsics () )) {
381+ if (!C.getLangOpts ().NativeHalfType &&
382+ C.getTargetInfo ().useFP16ConversionIntrinsics ()) {
383383 CGF.CGM .Error (E->getExprLoc (), C.BuiltinInfo .getQuotedName (BuiltinID) +
384384 " requires native half type support." );
385385 return false ;
@@ -1069,14 +1069,13 @@ Value *CodeGenFunction::EmitNVPTXBuiltinExpr(unsigned BuiltinID,
10691069 EmitScalarExpr (E->getArg (0 )));
10701070 case NVPTX::BI__nvvm_ldg_h:
10711071 case NVPTX::BI__nvvm_ldg_h2:
1072- if (!EnsureNativeHalfSupport (BuiltinID, E, *this ))
1073- return nullptr ;
1074- return MakeLdg (*this , E);
1072+ return EnsureNativeHalfSupport (BuiltinID, E, *this ) ? MakeLdg (*this , E)
1073+ : nullptr ;
10751074 case NVPTX::BI__nvvm_ldu_h:
10761075 case NVPTX::BI__nvvm_ldu_h2:
1077- if (! EnsureNativeHalfSupport (BuiltinID, E, *this ) )
1078- return nullptr ;
1079- return MakeLdu (Intrinsic::nvvm_ldu_global_f, * this , E) ;
1076+ return EnsureNativeHalfSupport (BuiltinID, E, *this )
1077+ ? MakeLdu (Intrinsic::nvvm_ldu_global_f, * this , E)
1078+ : nullptr ;
10801079 case NVPTX::BI__nvvm_cp_async_ca_shared_global_4:
10811080 return MakeCpAsync (Intrinsic::nvvm_cp_async_ca_shared_global_4,
10821081 Intrinsic::nvvm_cp_async_ca_shared_global_4_s, *this , E,
0 commit comments