From: Matt Arsenault Date: Mon, 17 Oct 2022 05:26:13 +0000 (-0700) Subject: InstSimplify: Add new baseline tests for fdiv X-Git-Tag: upstream/17.0.6~28324 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ce5f93d03c24ad780f099eccc2dc768e9e9e30f;p=platform%2Fupstream%2Fllvm.git InstSimplify: Add new baseline tests for fdiv --- diff --git a/llvm/test/Transforms/InstSimplify/fdiv.ll b/llvm/test/Transforms/InstSimplify/fdiv.ll index 2b998b3..2b583a0 100644 --- a/llvm/test/Transforms/InstSimplify/fdiv.ll +++ b/llvm/test/Transforms/InstSimplify/fdiv.ll @@ -59,3 +59,102 @@ define <2 x i1> @pr6096() { %fcmp = fcmp ole <2 x float> %fdiv, zeroinitializer ret <2 x i1> %fcmp } + + +; https://alive2.llvm.org/ce/z/JxX5in +define float @fdiv_nnan_ninf_by_zero_f32(float %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_zero_f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan ninf float [[X:%.*]], 0.000000e+00 +; CHECK-NEXT: ret float [[FDIV]] +; + %fdiv = fdiv nnan ninf float %x, 0.0 + ret float %fdiv +} + +define float @fdiv_nnan_ninf_by_negzero_f32(float %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_negzero_f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan ninf float [[X:%.*]], -0.000000e+00 +; CHECK-NEXT: ret float [[FDIV]] +; + %fdiv = fdiv nnan ninf float %x, -0.0 + ret float %fdiv +} + +define float @fdiv_nnan_ninf_by_undef_f32(float %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_undef_f32( +; CHECK-NEXT: ret float poison +; + %fdiv = fdiv nnan ninf float %x, undef + ret float %fdiv +} + +define float @fdiv_nnan_ninf_by_poison_f32(float %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_poison_f32( +; CHECK-NEXT: ret float poison +; + %fdiv = fdiv nnan ninf float %x, poison + ret float %fdiv +} + +define <2 x float> @fdiv_nnan_ninf_by_zero_v2f32(<2 x float> %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_zero_v2f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan ninf <2 x float> [[X:%.*]], zeroinitializer +; CHECK-NEXT: ret <2 x float> [[FDIV]] +; + %fdiv = fdiv nnan ninf <2 x float> %x, zeroinitializer + ret <2 x float> %fdiv +} + +define <2 x float> @fdiv_nnan_ninf_by_undef_v2f32(<2 x float> %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_undef_v2f32( +; CHECK-NEXT: ret <2 x float> poison +; + %fdiv = fdiv nnan ninf <2 x float> %x, undef + ret <2 x float> %fdiv +} + +define <2 x float> @fdiv_nnan_ninf_by_zero_undef_v2f32(<2 x float> %x) { +; CHECK-LABEL: @fdiv_nnan_ninf_by_zero_undef_v2f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan ninf <2 x float> [[X:%.*]], +; CHECK-NEXT: ret <2 x float> [[FDIV]] +; + %fdiv = fdiv nnan ninf <2 x float> %x, + ret <2 x float> %fdiv +} + +; https://alive2.llvm.org/ce/z/wRV28p +define float @fdiv_nnan_nsz_ninf_by_zero_f32(float %x) { +; CHECK-LABEL: @fdiv_nnan_nsz_ninf_by_zero_f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan nsz float [[X:%.*]], 0.000000e+00 +; CHECK-NEXT: ret float [[FDIV]] +; + %fdiv = fdiv nnan nsz float %x, 0.0 + ret float %fdiv +} + +define float @fdiv_nnan_nsz_ninf_by_negzero_f32(float %x) { +; CHECK-LABEL: @fdiv_nnan_nsz_ninf_by_negzero_f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan nsz float [[X:%.*]], -0.000000e+00 +; CHECK-NEXT: ret float [[FDIV]] +; + %fdiv = fdiv nnan nsz float %x, -0.0 + ret float %fdiv +} + +define <2 x float> @fdiv_nnan_nsz_ninf_by_zero_v2f32(<2 x float> %x) { +; CHECK-LABEL: @fdiv_nnan_nsz_ninf_by_zero_v2f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan nsz <2 x float> [[X:%.*]], zeroinitializer +; CHECK-NEXT: ret <2 x float> [[FDIV]] +; + %fdiv = fdiv nnan nsz <2 x float> %x, zeroinitializer + ret <2 x float> %fdiv +} + +define <2 x float> @fdiv_nnan_nsz_ninf_by_negzero_v2f32(<2 x float> %x) { +; CHECK-LABEL: @fdiv_nnan_nsz_ninf_by_negzero_v2f32( +; CHECK-NEXT: [[FDIV:%.*]] = fdiv nnan nsz <2 x float> [[X:%.*]], +; CHECK-NEXT: ret <2 x float> [[FDIV]] +; + %fdiv = fdiv nnan nsz <2 x float> %x, + ret <2 x float> %fdiv +}