[llvm] e82a54a - [NFC] [PowerPC] Remove unsafe-fp-math in some tests

Qiu Chaofan via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 01:31:41 PST 2021


Author: Qiu Chaofan
Date: 2021-03-10T17:27:21+08:00
New Revision: e82a54ae87cb65a91f583570636461e7b2046b6f

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

LOG: [NFC] [PowerPC] Remove unsafe-fp-math in some tests

As we're going to replace this ambiguous option with more precise
instruction-level fast-math description, some tests need to be updated
and the option doesn't play any role in some of them.

Added: 
    

Modified: 
    llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll
    llvm/test/CodeGen/PowerPC/fdiv-combine.ll
    llvm/test/CodeGen/PowerPC/fma-mutate-register-constraint.ll
    llvm/test/CodeGen/PowerPC/unsafe-math.ll
    llvm/test/CodeGen/PowerPC/vector-rounding-ops.ll
    llvm/test/CodeGen/PowerPC/vsx-recip-est.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll b/llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll
index c59415874489..cff144eb650e 100644
--- a/llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll
+++ b/llvm/test/CodeGen/PowerPC/buildvec_canonicalize.ll
@@ -1,4 +1,4 @@
-; RUN: llc -verify-machineinstrs < %s -mattr=-vsx -mtriple=ppc32-- -mattr=+altivec --enable-unsafe-fp-math | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mattr=-vsx -mtriple=ppc32-- -mattr=+altivec | FileCheck %s
 
 define void @VXOR(<4 x float>* %P1, <4 x i32>* %P2, <4 x float>* %P3) {
         %tmp = load <4 x float>, <4 x float>* %P3            ; <<4 x float>> [#uses=1]

diff  --git a/llvm/test/CodeGen/PowerPC/fdiv-combine.ll b/llvm/test/CodeGen/PowerPC/fdiv-combine.ll
index fdc546ec1261..21693603207d 100644
--- a/llvm/test/CodeGen/PowerPC/fdiv-combine.ll
+++ b/llvm/test/CodeGen/PowerPC/fdiv-combine.ll
@@ -1,6 +1,4 @@
-; RUN: llc -verify-machineinstrs -mcpu=ppc64 < %s | FileCheck %s
-target datalayout = "E-m:e-i64:64-n32:64"
-target triple = "powerpc64-unknown-linux-gnu"
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s
 
 ; Following test case checks:
 ;   a / D; b / D; c / D;
@@ -14,9 +12,9 @@ define void @three_fdiv_double(double %D, double %a, double %b, double %c) #0 {
 ; CHECK: fmul
 ; CHECK: fmul
 ; CHECK: fmul
-  %div = fdiv double %a, %D
-  %div1 = fdiv double %b, %D
-  %div2 = fdiv double %c, %D
+  %div = fdiv arcp double %a, %D
+  %div1 = fdiv arcp double %b, %D
+  %div2 = fdiv arcp double %c, %D
   tail call void @foo_3d(double %div, double %div1, double %div2)
   ret void
 }
@@ -26,8 +24,8 @@ define void @two_fdiv_double(double %D, double %a, double %b) #0 {
 ; CHECK: fdiv {{[0-9]}}
 ; CHECK: fdiv {{[0-9]}}
 ; CHECK-NOT: fmul
-  %div = fdiv double %a, %D
-  %div1 = fdiv double %b, %D
+  %div = fdiv arcp double %a, %D
+  %div1 = fdiv arcp double %b, %D
   tail call void @foo_2d(double %div, double %div1)
   ret void
 }
@@ -35,5 +33,3 @@ define void @two_fdiv_double(double %D, double %a, double %b) #0 {
 declare void @foo_3d(double, double, double)
 declare void @foo_3_2xd(<2 x double>, <2 x double>, <2 x double>)
 declare void @foo_2d(double, double)
-
-attributes #0 = { "unsafe-fp-math"="true" }

diff  --git a/llvm/test/CodeGen/PowerPC/fma-mutate-register-constraint.ll b/llvm/test/CodeGen/PowerPC/fma-mutate-register-constraint.ll
index 720993ff0de8..2735b3d2357d 100644
--- a/llvm/test/CodeGen/PowerPC/fma-mutate-register-constraint.ll
+++ b/llvm/test/CodeGen/PowerPC/fma-mutate-register-constraint.ll
@@ -1,6 +1,4 @@
-; RUN: llc -verify-machineinstrs -enable-unsafe-fp-math < %s | FileCheck %s
-target datalayout = "e-m:e-i64:64-n32:64"
-target triple = "powerpc64le-unknown-linux-gnu"
+; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s
 
 ; CHECK-NOT: {{vmrg[hl]w.*(3[23456789]|[456][0-9])}}
 define void @__f0() {

diff  --git a/llvm/test/CodeGen/PowerPC/unsafe-math.ll b/llvm/test/CodeGen/PowerPC/unsafe-math.ll
index edc970b4d162..ed99608a4fe0 100644
--- a/llvm/test/CodeGen/PowerPC/unsafe-math.ll
+++ b/llvm/test/CodeGen/PowerPC/unsafe-math.ll
@@ -1,10 +1,29 @@
-; RUN: llc -verify-machineinstrs < %s -mattr=-vsx -mtriple=ppc32-- | grep fmul | count 2
-; RUN: llc -verify-machineinstrs < %s -mattr=-vsx -mtriple=ppc32-- -enable-unsafe-fp-math | \
-; RUN:   grep fmul | count 1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -verify-machineinstrs < %s -mattr=-vsx -mtriple=ppc32-- | FileCheck %s
 
 define double @foo(double %X) nounwind {
-        %tmp1 = fmul double %X, 1.23
-        %tmp2 = fmul double %tmp1, 4.124
-        ret double %tmp2
+; CHECK-LABEL: foo:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    lis 3, .LCPI0_0 at ha
+; CHECK-NEXT:    lfd 0, .LCPI0_0 at l(3)
+; CHECK-NEXT:    lis 3, .LCPI0_1 at ha
+; CHECK-NEXT:    lfd 2, .LCPI0_1 at l(3)
+; CHECK-NEXT:    fmul 0, 1, 0
+; CHECK-NEXT:    fmul 1, 0, 2
+; CHECK-NEXT:    blr
+  %tmp1 = fmul double %X, 1.23
+  %tmp2 = fmul double %tmp1, 4.124
+  ret double %tmp2
 }
 
+define double @foo_reassoc(double %X) nounwind {
+; CHECK-LABEL: foo_reassoc:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    lis 3, .LCPI1_0 at ha
+; CHECK-NEXT:    lfd 0, .LCPI1_0 at l(3)
+; CHECK-NEXT:    fmul 1, 1, 0
+; CHECK-NEXT:    blr
+  %tmp1 = fmul reassoc double %X, 1.23
+  %tmp2 = fmul reassoc double %tmp1, 4.124
+  ret double %tmp2
+}

diff  --git a/llvm/test/CodeGen/PowerPC/vector-rounding-ops.ll b/llvm/test/CodeGen/PowerPC/vector-rounding-ops.ll
index 8cbee6cc94b8..52ccb2426d41 100644
--- a/llvm/test/CodeGen/PowerPC/vector-rounding-ops.ll
+++ b/llvm/test/CodeGen/PowerPC/vector-rounding-ops.ll
@@ -5,9 +5,6 @@
 ; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
 ; RUN:   -mtriple=powerpc64le-unknown-unknown -verify-machineinstrs < %s | \
 ; RUN:   FileCheck %s
-; RUN: llc -mcpu=pwr8 -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr \
-; RUN:   -mtriple=powerpc64le-unknown-unknown -verify-machineinstrs < %s \
-; RUN:   --enable-unsafe-fp-math | FileCheck %s --check-prefix=FAST
 
 define dso_local <2 x double> @test_rint_v2f64(<2 x double> %d) local_unnamed_addr {
 ; P9-LABEL: test_rint_v2f64:
@@ -19,11 +16,6 @@ define dso_local <2 x double> @test_rint_v2f64(<2 x double> %d) local_unnamed_ad
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    xvrdpic v2, v2
 ; CHECK-NEXT:    blr
-;
-; FAST-LABEL: test_rint_v2f64:
-; FAST:       # %bb.0: # %entry
-; FAST-NEXT:    xvrdpic v2, v2
-; FAST-NEXT:    blr
 entry:
   %0 = tail call <2 x double> @llvm.rint.v2f64(<2 x double> %d)
   ret <2 x double> %0
@@ -42,11 +34,6 @@ define dso_local <4 x float> @test_rint_v4f32(<4 x float> %d) local_unnamed_addr
 ; CHECK:       # %bb.0: # %entry
 ; CHECK-NEXT:    xvrspic v2, v2
 ; CHECK-NEXT:    blr
-;
-; FAST-LABEL: test_rint_v4f32:
-; FAST:       # %bb.0: # %entry
-; FAST-NEXT:    xvrspic v2, v2
-; FAST-NEXT:    blr
 entry:
   %0 = tail call <4 x float> @llvm.rint.v4f32(<4 x float> %d)
   ret <4 x float> %0

diff  --git a/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll b/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll
index 969f480069d1..bab1dcb791c1 100644
--- a/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll
+++ b/llvm/test/CodeGen/PowerPC/vsx-recip-est.ll
@@ -1,5 +1,5 @@
-; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -enable-unsafe-fp-math | FileCheck %s
-; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -enable-unsafe-fp-math | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
+; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 | FileCheck %s
 @a = global float 3.000000e+00, align 4
 @b = global float 4.000000e+00, align 4
 @c = global double 3.000000e+00, align 8


        


More information about the llvm-commits mailing list