Home | History | Annotate | Download | only in AMDGPU
      1 ; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=GCN %s
      2 ; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck --check-prefix=GCN %s
      3 
      4 ; GCN-LABEL: {{^}}icmp_2_users:
      5 ; GCN: s_cmp_lt_i32 s{{[0-9]+}}, 1
      6 ; GCN: s_cbranch_scc1 [[LABEL:BB[0-9_A-Z]+]]
      7 ; GCN: [[LABEL]]:
      8 ; GCN-NEXT: s_endpgm
      9 define void @icmp_2_users(i32 addrspace(1)* %out, i32 %cond) {
     10 main_body:
     11   %0 = icmp sgt i32 %cond, 0
     12   %1 = sext i1 %0 to i32
     13   br i1 %0, label %IF, label %ENDIF
     14 
     15 IF:
     16   store i32 %1, i32 addrspace(1)* %out
     17   br label %ENDIF
     18 
     19 ENDIF:                                            ; preds = %IF, %main_body
     20   ret void
     21 }
     22 
     23 ; GCN-LABEL: {{^}}fix_sgpr_live_ranges_crash:
     24 ; GCN: s_cbranch_scc1 [[BB0:[A-Z0-9_]+]]
     25 ; GCN: {{^}}[[LOOP:[A-Z0-9_]+]]:
     26 ; GCN: s_cbranch_scc1 [[LOOP]]
     27 ; GCN: {{^}}[[BB0]]:
     28 define void @fix_sgpr_live_ranges_crash(i32 %arg, i32 %arg1)  {
     29 bb:
     30   %cnd = trunc i32 %arg to i1
     31   br i1 %cnd, label %bb2, label %bb5
     32 
     33 bb2:                                              ; preds = %bb
     34   %tmp = mul i32 10, %arg1
     35   br label %bb3
     36 
     37 bb3:                                              ; preds = %bb3, %bb2
     38   %val = load volatile i32, i32 addrspace(2)* undef
     39   %tmp4 = icmp eq i32 %val, %arg1
     40   br i1 %tmp4, label %bb5, label %bb3
     41 
     42 bb5:                                              ; preds = %bb3, %bb
     43   %tmp6 = tail call i32 @llvm.amdgcn.workitem.id.y() #1
     44   %tmp10 = icmp ult i32 %tmp6, %arg
     45   br i1 %tmp10, label %bb11, label %bb12
     46 
     47 bb11:                                             ; preds = %bb11, %bb5
     48   br i1 undef, label %bb11, label %bb12
     49 
     50 bb12:                                             ; preds = %bb11, %bb5
     51   ret void
     52 }
     53 
     54 ; Function Attrs: nounwind readnone
     55 declare i32 @llvm.amdgcn.workitem.id.y() #1
     56 
     57 attributes #1 = { nounwind readnone }
     58