• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
3; RUN:     -mcpu=pwr6 -ppc-asm-full-reg-names -mattr=-vsx \
4; RUN:     -ppc-vsr-nums-as-vr < %s | FileCheck %s
5
6; There is code in the SDAG to expand FMAX/FMIN with fast flags to SELECT_CC.
7; On PPC, we had SELECT_CC legalized using Promote for all vector types
8; (including the type that they are all promoted to - which caused an infinite
9; loop in legalization). This test just ensures that we terminate on such input.
10define dso_local void @_ZN1a1bEv(<4 x float> %in) local_unnamed_addr #0 align 2 {
11; CHECK-LABEL: _ZN1a1bEv:
12; CHECK:       # %bb.0:
13; CHECK-NEXT:    bc 12, 4*cr5+lt, .LBB0_6
14; CHECK-NEXT:    b .LBB0_1
15; CHECK-NEXT:  .LBB0_1: # %.preheader
16; CHECK-NEXT:    b .LBB0_2
17; CHECK-NEXT:  .LBB0_2:
18; CHECK-NEXT:    b .LBB0_3
19; CHECK-NEXT:  .LBB0_3:
20; CHECK-NEXT:    addis r3, r2, .LCPI0_0@toc@ha
21; CHECK-NEXT:    addi r3, r3, .LCPI0_0@toc@l
22; CHECK-NEXT:    lvx v3, 0, r3
23; CHECK-NEXT:    vperm v2, v2, v2, v3
24; CHECK-NEXT:    vxor v3, v3, v3
25; CHECK-NEXT:    addi r3, r1, -48
26; CHECK-NEXT:    stvx v3, 0, r3
27; CHECK-NEXT:    addi r3, r1, -32
28; CHECK-NEXT:    stvx v2, 0, r3
29; CHECK-NEXT:    lwz r3, -48(r1)
30; CHECK-NEXT:    lwz r4, -32(r1)
31; CHECK-NEXT:    cmpw r4, r3
32; CHECK-NEXT:    bc 12, gt, .LBB0_4
33; CHECK-NEXT:    b .LBB0_5
34; CHECK-NEXT:  .LBB0_4:
35; CHECK-NEXT:    addi r3, r4, 0
36; CHECK-NEXT:  .LBB0_5:
37; CHECK-NEXT:    cmpw r3, r3
38; CHECK-NEXT:    stw r3, -64(r1)
39; CHECK-NEXT:    addi r3, r1, -64
40; CHECK-NEXT:    lvx v2, 0, r3
41; CHECK-NEXT:    addi r3, r1, -16
42; CHECK-NEXT:    stvx v2, 0, r3
43; CHECK-NEXT:  .LBB0_6:
44; CHECK-NEXT:    blr
45  br i1 undef, label %7, label %1
46
471:                                                ; preds = %1, %0
48  br i1 undef, label %2, label %1
49
502:                                                ; preds = %1
51  %3 = shufflevector <4 x float> %in, <4 x float> undef, <4 x i32> <i32 2, i32 3, i32 1, i32 0>
52  %4 = call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> %3, <4 x float> zeroinitializer)
53  %5 = call fast <4 x float> @llvm.maxnum.v4f32(<4 x float> %4, <4 x float> undef)
54  %6 = extractelement <4 x float> %5, i32 0
55  br label %7
56
577:                                                ; preds = %2, %0
58  %8 = phi float [ %6, %2 ], [ undef, %0 ]
59  %9 = fcmp fast une float %8, 0.000000e+00
60  ret void
61}
62
63declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>) #0
64
65attributes #0 = { nounwind optnone noinline }
66