Revert rGe6ccb57bb3f6b761f2310e97fd6ca99eff42f73e "[SLP] Add cost model for `llvm...
[llvm-project.git] / llvm / test / CodeGen / PowerPC / repeated-fp-divisors.ll
blob17dafc1caef52c132a67930505671afbddbbf466
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-- < %s | FileCheck %s
4 ; Check if this causes infinite loop when estimation disabled
5 define <4 x float> @repeated_fp_divisor_noest(float %a, <4 x float> %b) {
6 ; CHECK-LABEL: repeated_fp_divisor_noest:
7 ; CHECK:       # %bb.0:
8 ; CHECK-NEXT:    xscvdpspn 0, 1
9 ; CHECK-NEXT:    addis 3, 2, .LCPI0_1@toc@ha
10 ; CHECK-NEXT:    addi 3, 3, .LCPI0_1@toc@l
11 ; CHECK-NEXT:    lxvd2x 1, 0, 3
12 ; CHECK-NEXT:    addis 3, 2, .LCPI0_0@toc@ha
13 ; CHECK-NEXT:    addi 3, 3, .LCPI0_0@toc@l
14 ; CHECK-NEXT:    xxswapd 35, 1
15 ; CHECK-NEXT:    lxvd2x 1, 0, 3
16 ; CHECK-NEXT:    xxspltw 0, 0, 0
17 ; CHECK-NEXT:    xvdivsp 0, 35, 0
18 ; CHECK-NEXT:    xxswapd 35, 1
19 ; CHECK-NEXT:    xvmulsp 1, 34, 35
20 ; CHECK-NEXT:    xvmulsp 34, 1, 0
21 ; CHECK-NEXT:    blr
22   %ins = insertelement <4 x float> undef, float %a, i32 0
23   %splat = shufflevector <4 x float> %ins, <4 x float> undef, <4 x i32> zeroinitializer
24   %t1 = fmul reassoc <4 x float> %b, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0x3FF028F5C0000000>
25   %mul = fdiv reassoc arcp nsz <4 x float> %t1, %splat
26   ret <4 x float> %mul
29 define <4 x float> @repeated_fp_divisor(float %a, <4 x float> %b) {
30 ; CHECK-LABEL: repeated_fp_divisor:
31 ; CHECK:       # %bb.0:
32 ; CHECK-NEXT:    xscvdpspn 0, 1
33 ; CHECK-NEXT:    addis 3, 2, .LCPI1_0@toc@ha
34 ; CHECK-NEXT:    addi 3, 3, .LCPI1_0@toc@l
35 ; CHECK-NEXT:    lxvd2x 1, 0, 3
36 ; CHECK-NEXT:    addis 3, 2, .LCPI1_1@toc@ha
37 ; CHECK-NEXT:    addi 3, 3, .LCPI1_1@toc@l
38 ; CHECK-NEXT:    xxswapd 1, 1
39 ; CHECK-NEXT:    xxspltw 0, 0, 0
40 ; CHECK-NEXT:    xvresp 2, 0
41 ; CHECK-NEXT:    xvmaddasp 1, 0, 2
42 ; CHECK-NEXT:    lxvd2x 0, 0, 3
43 ; CHECK-NEXT:    xxswapd 35, 0
44 ; CHECK-NEXT:    xvnmsubasp 2, 2, 1
45 ; CHECK-NEXT:    xvmulsp 0, 34, 35
46 ; CHECK-NEXT:    xvmulsp 34, 0, 2
47 ; CHECK-NEXT:    blr
48   %ins = insertelement <4 x float> undef, float %a, i32 0
49   %splat = shufflevector <4 x float> %ins, <4 x float> undef, <4 x i32> zeroinitializer
50   %t1 = fmul contract reassoc <4 x float> %b, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0x3FF028F5C0000000>
51   %mul = fdiv contract reassoc arcp nsz ninf <4 x float> %t1, %splat
52   ret <4 x float> %mul