1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx906 -amdgpu-enable-rewrite-partial-reg-uses=false -verify-machineinstrs < %s | FileCheck %s
4 ; This example used to produce a verifier error resulting from the
5 ; register coalescer leaving behind a false live interval when a live
6 ; out copy introduced new liveness for a subregister.
8 define <3 x float> @liveout_undef_subrange(<3 x float> %arg) {
9 ; CHECK-LABEL: liveout_undef_subrange:
10 ; CHECK: ; %bb.0: ; %bb
11 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
12 ; CHECK-NEXT: v_add_f32_e32 v3, v2, v2
13 ; CHECK-NEXT: s_mov_b64 s[4:5], 0
14 ; CHECK-NEXT: ; kill: killed $vgpr1
15 ; CHECK-NEXT: v_add_f32_e32 v0, v0, v0
16 ; CHECK-NEXT: .LBB0_1: ; %bb1
17 ; CHECK-NEXT: ; =>This Inner Loop Header: Depth=1
18 ; CHECK-NEXT: v_cmp_neq_f32_e32 vcc, 0, v2
19 ; CHECK-NEXT: s_or_b64 s[4:5], vcc, s[4:5]
20 ; CHECK-NEXT: s_andn2_b64 exec, exec, s[4:5]
21 ; CHECK-NEXT: s_cbranch_execnz .LBB0_1
22 ; CHECK-NEXT: ; %bb.2: ; %bb2
23 ; CHECK-NEXT: ; in Loop: Header=BB0_1 Depth=1
24 ; CHECK-NEXT: s_or_b64 exec, exec, s[4:5]
25 ; CHECK-NEXT: v_mul_f32_e32 v2, v3, v2
26 ; CHECK-NEXT: s_mov_b64 s[4:5], 0
27 ; CHECK-NEXT: s_cbranch_execnz .LBB0_1
28 ; CHECK-NEXT: ; %bb.3: ; %DummyReturnBlock
29 ; CHECK-NEXT: s_setpc_b64 s[30:31]
33 bb1: ; preds = %bb3, %bb
34 %i = phi <3 x float> [ %arg, %bb ], [ %i11, %bb3 ]
35 %i2 = extractelement <3 x float> %i, i64 2
36 %i3 = fmul float %i2, 1.000000e+00
37 %i4 = fmul nsz <3 x float> %arg, <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>
38 %i5 = insertelement <3 x float> undef, float %i3, i32 0
39 %i6 = shufflevector <3 x float> %i5, <3 x float> undef, <3 x i32> zeroinitializer
40 %i7 = fmul <3 x float> %i4, %i6
41 %i8 = fcmp oeq float %i3, 0.000000e+00
42 br i1 %i8, label %bb3, label %bb2
47 bb3: ; preds = %bb2, %bb1
48 %i11 = phi <3 x float> [ %i7, %bb2 ], [ %i, %bb1 ]