1; RUN: llc < %s -mtriple=amdgcn--amdpal -mcpu=gfx900 -verify-machineinstrs | FileCheck %s
2
3; Check that the redundant immediate MOV instruction
4; (by-product of handling phi nodes) is not found
5; in the generated code.
6
7; CHECK-LABEL: {{^}}mov_opt:
8; CHECK: s_mov_b32 [[SREG:s[0-9]+]], 1.0
9; CHECK: %bb.1:
10; CHECK-NOT: v_mov_b32_e32 {{v[0-9]+}}, 1.0
11; CHECK: BB0_3:
12; CHECK: v_mov_b32_e32 v{{[0-9]+}}, [[SREG]]
13
14define amdgpu_ps void @mov_opt(i32 %arg, i32 inreg %arg1, i32 inreg %arg2) local_unnamed_addr #0 {
15bb:
16  %tmp = icmp eq i32 %arg1, 0
17  br i1 %tmp, label %bb3, label %bb10
18
19bb3:                                              ; preds = %bb
20  %tmp4 = icmp eq i32 %arg2, 0
21  br i1 %tmp4, label %bb5, label %bb10
22
23bb5:                                              ; preds = %bb3
24  %tmp6 = getelementptr <{ [4294967295 x i32] }>, <{ [4294967295 x i32] }> addrspace(6)* null, i32 0, i32 0, i32 %arg
25  %tmp7 = load i32, i32 addrspace(6)* %tmp6
26  %tmp8 = icmp eq i32 %tmp7, 1
27  br i1 %tmp8, label %bb10, label %bb9
28
29bb9:                                              ; preds = %bb5
30  br label %bb10
31
32bb10:                                             ; preds = %bb9, %bb5, %bb3, %bb
33  %tmp11 = phi float [ 1.000000e+00, %bb3 ], [ 0.000000e+00, %bb9 ], [ 1.000000e+00, %bb ], [ undef, %bb5 ]
34  call void @llvm.amdgcn.exp.f32(i32 immarg 40, i32 immarg 15, float %tmp11, float undef, float undef, float undef, i1 immarg false, i1 immarg false) #0
35  ret void
36}
37
38; Function Attrs: inaccessiblememonly nounwind
39declare void @llvm.amdgcn.exp.f32(i32 immarg, i32 immarg, float, float, float, float, i1 immarg, i1 immarg) #1
40
41attributes #0 = { nounwind }
42attributes #1 = { inaccessiblememonly nounwind }
43