]> granicus.if.org Git - llvm/commitdiff
[InstCombine] add fast-math-flags for better test coverage; NFC
authorSanjay Patel <spatel@rotateright.com>
Sun, 6 Oct 2019 13:19:05 +0000 (13:19 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 6 Oct 2019 13:19:05 +0000 (13:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373848 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/fmul.ll

index 5ab6d93c834b842860ad0e8b64803ca0aa630e43..1bcca95d045362a1af521e757203c8016dd02f0f 100644 (file)
@@ -1006,11 +1006,11 @@ define float @negate_if_true(float %x, i1 %cond) {
 define float @negate_if_false(float %x, i1 %cond) {
 ; CHECK-LABEL: @negate_if_false(
 ; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND:%.*]], float 1.000000e+00, float -1.000000e+00
-; CHECK-NEXT:    [[R:%.*]] = fmul float [[SEL]], [[X:%.*]]
+; CHECK-NEXT:    [[R:%.*]] = fmul arcp float [[SEL]], [[X:%.*]]
 ; CHECK-NEXT:    ret float [[R]]
 ;
   %sel = select i1 %cond, float 1.0, float -1.0
-  %r = fmul float %sel, %x
+  %r = fmul arcp float %sel, %x
   ret float %r
 }
 
@@ -1018,12 +1018,12 @@ define <2 x double> @negate_if_true_commute(<2 x double> %px, i1 %cond) {
 ; CHECK-LABEL: @negate_if_true_commute(
 ; CHECK-NEXT:    [[X:%.*]] = fdiv <2 x double> <double 4.200000e+01, double 4.200000e+01>, [[PX:%.*]]
 ; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[COND:%.*]], <2 x double> <double -1.000000e+00, double -1.000000e+00>, <2 x double> <double 1.000000e+00, double 1.000000e+00>
-; CHECK-NEXT:    [[R:%.*]] = fmul <2 x double> [[X]], [[SEL]]
+; CHECK-NEXT:    [[R:%.*]] = fmul ninf <2 x double> [[X]], [[SEL]]
 ; CHECK-NEXT:    ret <2 x double> [[R]]
 ;
   %x = fdiv <2 x double> <double 42.0, double 42.0>, %px  ; thwart complexity-based canonicalization
   %sel = select i1 %cond, <2 x double> <double -1.0, double -1.0>, <2 x double> <double 1.0, double 1.0>
-  %r = fmul <2 x double> %x, %sel
+  %r = fmul ninf <2 x double> %x, %sel
   ret <2 x double> %r
 }