[clang] [llvm] Clang: emit llvm.minnum and llvm.maxnum with nsz always (PR #113133)

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 10:26:42 PDT 2024


================
@@ -2858,10 +2862,13 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
     case Builtin::BI__builtin_fminf:
     case Builtin::BI__builtin_fminf16:
     case Builtin::BI__builtin_fminl:
-    case Builtin::BI__builtin_fminf128:
-      return RValue::get(emitBinaryMaybeConstrainedFPBuiltin(*this, E,
-                                   Intrinsic::minnum,
-                                   Intrinsic::experimental_constrained_minnum));
+    case Builtin::BI__builtin_fminf128: {
+      llvm::FastMathFlags FMF;
+      FMF.setNoSignedZeros();
+      return RValue::get(emitBinaryMaybeConstrainedFPBuiltin(
+          *this, E, Intrinsic::minnum,
+          Intrinsic::experimental_constrained_minnum, &FMF));
----------------
arsenm wrote:

Need to test the strictfp cases 

https://github.com/llvm/llvm-project/pull/113133


More information about the cfe-commits mailing list