[llvm] [InstCombine] Ensure Safe Handling of Flags in foldFNegIntoConstant (PR #94148)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 11:32:48 PDT 2024


================
@@ -1109,4 +1109,45 @@ define float @test_fneg_select_maxnum(float %x) {
   ret float %neg
 }
 
+define float @test_fneg_ninf_mul_with_anyzero(float %a) {
+; CHECK-LABEL: @test_fneg_ninf_mul_with_anyzero(
+; CHECK-NEXT:    [[F:%.*]] = fmul float [[A:%.*]], -0.000000e+00
+; CHECK-NEXT:    ret float [[F]]
+;
+  %mul = fmul float %a, 0.0
----------------
arsenm wrote:

Also need tests with -0. Also vector tests with mixed elements 

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


More information about the llvm-commits mailing list