[clang] [llvm] Clang: Add nsz to llvm.minnum and llvm.maxnum emitted from fmin and fmax (PR #113133)
YunQiang Su via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 8 21:52:42 PST 2025
================
@@ -4002,8 +4012,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
Result = Builder.CreateBinaryIntrinsic(
Ty->isSignedIntegerType() ? Intrinsic::smin : Intrinsic::umin, Op0,
Op1, nullptr, "elt.min");
- } else
- Result = Builder.CreateMinNum(Op0, Op1, /*FMFSource=*/nullptr, "elt.min");
+ } else {
+ FastMathFlags FMF;
+ FMF.setNoSignedZeros(true);
----------------
wzssyqa wrote:
You can notice that we have already:
```
__builtin_elementwise_maximum
__builtin_elementwise_minimum
```
before https://github.com/llvm/llvm-project/pull/129207
And with https://github.com/llvm/llvm-project/pull/129207
we introduce
```
__builtin_elementwise_maxnum
__builtin_elementwise_minnum
```
So in the best, we should keep the name scheme: not prefix `f`.
https://github.com/llvm/llvm-project/pull/113133
More information about the llvm-commits
mailing list