xref: /llvm-project/llvm/test/CodeGen/AMDGPU/build-vector-insert-elt-infloop.ll (revision bdf2fbba9cee60b4b260ff17e4f44c475c11e715)
1; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2
3; There was an infinite loop in DAGCombiner from a target build_vector
4; combine and a generic insert_vector_elt combine.
5
6; GCN-LABEL: {{^}}combine_loop:
7; GCN: flat_load_short_d16_hi
8; GCN: flat_store_short
9define amdgpu_kernel void @combine_loop(ptr %arg) #0 {
10bb:
11  br label %bb1
12
13bb1:
14  %tmp = phi <2 x i16> [ <i16 15360, i16 15360>, %bb ], [ %tmp5, %bb1 ]
15  %tmp2 = phi half [ 0xH0000, %bb ], [ %tmp8, %bb1 ]
16  %tmp3 = load volatile half, ptr null, align 536870912
17  %tmp4 = bitcast half %tmp3 to i16
18  %tmp5 = insertelement <2 x i16> <i16 0, i16 undef>, i16 %tmp4, i32 1
19  store volatile half %tmp2, ptr %arg, align 2
20  %tmp7 = bitcast <2 x i16> %tmp to <2 x half>
21  %tmp8 = extractelement <2 x half> %tmp7, i32 0
22  br label %bb1
23}
24
25attributes #0 = { nounwind }
26