[llvm] [X86] Remove `NoSignedZerosFPMath` uses (PR #163902)
Mikołaj Piróg via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 3 05:51:00 PST 2026
================
@@ -1,110 +1,143 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=x86_64 -enable-no-nans-fp-math -enable-no-signed-zeros-fp-math -mattr=+avx512f | FileCheck %s --check-prefix=CHECK_UNSAFE
; RUN: llc < %s -mtriple=x86_64 -enable-no-nans-fp-math -mattr=+avx512f | FileCheck %s
-; RUN: llc < %s -mtriple=x86_64 -enable-no-signed-zeros-fp-math -mattr=+avx512f | FileCheck %s
-; RUN: llc < %s -mtriple=x86_64 -mattr=+avx512f | FileCheck %s
-; RUN: llc < %s -mtriple=x86_64 -mattr=+avx512f | FileCheck %s
define <16 x float> @test_max_v16f32(ptr %a_ptr, <16 x float> %b) {
-; CHECK_UNSAFE-LABEL: test_max_v16f32:
-; CHECK_UNSAFE: # %bb.0:
-; CHECK_UNSAFE-NEXT: vmaxps (%rdi), %zmm0, %zmm0
-; CHECK_UNSAFE-NEXT: retq
-;
; CHECK-LABEL: test_max_v16f32:
; CHECK: # %bb.0:
-; CHECK-NEXT: vmovaps (%rdi), %zmm1
-; CHECK-NEXT: vmaxps %zmm0, %zmm1, %zmm0
+; CHECK-NEXT: vmaxps (%rdi), %zmm0, %zmm0
; CHECK-NEXT: retq
%a = load <16 x float>, ptr %a_ptr
- %tmp = fcmp fast ogt <16 x float> %a, %b
- %tmp4 = select <16 x i1> %tmp, <16 x float> %a, <16 x float> %b
+ %tmp = fcmp ogt <16 x float> %a, %b
+ %tmp4 = select nnan nsz <16 x i1> %tmp, <16 x float> %a, <16 x float> %b
ret <16 x float> %tmp4;
}
+define <16 x float> @test_max_v16f32_safe(ptr %a_ptr, <16 x float> %b) {
+; CHECK-LABEL: test_max_v16f32_safe:
+; CHECK: # %bb.0:
+; CHECK-NEXT: vmaxps (%rdi), %zmm0, %zmm0
+; CHECK-NEXT: retq
+ %a = load <16 x float>, ptr %a_ptr
+ %tmp = fcmp ogt <16 x float> %a, %b
+ %tmp4 = select nsz <16 x i1> %tmp, <16 x float> %a, <16 x float> %b
----------------
mikolaj-pirog wrote:
Why do we consider `nsz` safe? This test is the same as the one above
https://github.com/llvm/llvm-project/pull/163902
More information about the llvm-commits
mailing list