[llvm] 149379d - [InstCombine] add tests for fmul nnan with 0.0; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 07:21:09 PDT 2022


Author: Sanjay Patel
Date: 2022-10-18T10:20:08-04:00
New Revision: 149379d538f29b82057db6f697f779fa85055cbb

URL: https://github.com/llvm/llvm-project/commit/149379d538f29b82057db6f697f779fa85055cbb
DIFF: https://github.com/llvm/llvm-project/commit/149379d538f29b82057db6f697f779fa85055cbb.diff

LOG: [InstCombine] add tests for fmul nnan with 0.0; NFC

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/fmul.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/fmul.ll b/llvm/test/Transforms/InstCombine/fmul.ll
index a5501ace531dd..1c393e6dcb868 100644
--- a/llvm/test/Transforms/InstCombine/fmul.ll
+++ b/llvm/test/Transforms/InstCombine/fmul.ll
@@ -1200,3 +1200,39 @@ define <vscale x 2 x float> @mul_scalable_splat_zero(<vscale x 2 x float> %z) {
   %t3 = fmul fast <vscale x 2 x float> %shuf, %z
   ret <vscale x 2 x float> %t3
 }
+
+define half @mul_zero_nnan(half %x) {
+; CHECK-LABEL: @mul_zero_nnan(
+; CHECK-NEXT:    [[R:%.*]] = fmul nnan half [[X:%.*]], 0xH0000
+; CHECK-NEXT:    ret half [[R]]
+;
+  %r = fmul nnan half %x, 0.0
+  ret half %r
+}
+
+define <2 x float> @mul_zero_nnan_vec_poison(<2 x float> %x) {
+; CHECK-LABEL: @mul_zero_nnan_vec_poison(
+; CHECK-NEXT:    [[R:%.*]] = fmul nnan <2 x float> [[X:%.*]], <float 0.000000e+00, float poison>
+; CHECK-NEXT:    ret <2 x float> [[R]]
+;
+  %r = fmul nnan <2 x float> %x, <float 0.0, float poison>
+  ret <2 x float> %r
+}
+
+define half @mul_zero(half %x) {
+; CHECK-LABEL: @mul_zero(
+; CHECK-NEXT:    [[R:%.*]] = fmul ninf nsz half [[X:%.*]], 0xH0000
+; CHECK-NEXT:    ret half [[R]]
+;
+  %r = fmul ninf nsz half %x, 0.0
+  ret half %r
+}
+
+define half @mul_negzero_nnan(half %x) {
+; CHECK-LABEL: @mul_negzero_nnan(
+; CHECK-NEXT:    [[R:%.*]] = fmul nnan half [[X:%.*]], 0xH8000
+; CHECK-NEXT:    ret half [[R]]
+;
+  %r = fmul nnan half %x, -0.0
+  ret half %r
+}


        


More information about the llvm-commits mailing list