brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 4a863cf Raw
106 lines · plain
1; RUN: opt -mtriple=amdgcn-- -S -structurizecfg -si-annotate-control-flow -simplifycfg-require-and-preserve-domtree=1 %s | FileCheck -check-prefix=OPT %s2; RUN: opt -mtriple=amdgcn-- -S -passes=structurizecfg,si-annotate-control-flow -simplifycfg-require-and-preserve-domtree=1 %s | FileCheck -check-prefix=OPT %s3; RUN: llc -mtriple=amdgcn -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck -check-prefix=GCN %s4 5; OPT-LABEL: @annotate_unreachable_noloop(6; OPT-NOT: call i1 @llvm.amdgcn.loop7 8; GCN-LABEL: {{^}}annotate_unreachable_noloop:9; GCN: s_cbranch_scc110; GCN-NOT: s_endpgm11; GCN: .Lfunc_end012define amdgpu_kernel void @annotate_unreachable_noloop(ptr addrspace(1) noalias nocapture readonly %arg) #0 {13bb:14  %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()15  br label %bb116 17bb1:                                              ; preds = %bb18  %tmp2 = sext i32 %tmp to i6419  %tmp3 = getelementptr inbounds <4 x float>, ptr addrspace(1) %arg, i64 %tmp220  %tmp4 = load <4 x float>, ptr addrspace(1) %tmp3, align 1621  br i1 poison, label %bb5, label %bb322 23bb3:                                              ; preds = %bb124  %tmp6 = extractelement <4 x float> %tmp4, i32 225  %tmp7 = fcmp olt float %tmp6, 0.000000e+0026  br i1 %tmp7, label %bb4, label %bb5 ; crash goes away if these are swapped27 28bb4:                                              ; preds = %bb329  unreachable30 31bb5:                                              ; preds = %bb3, %bb132  unreachable33}34 35 36; OPT-LABEL: @annotate_ret_noloop(37; OPT-NOT: call i1 @llvm.amdgcn.loop38 39; GCN-LABEL: {{^}}annotate_ret_noloop:40; GCN: load_dwordx441; GCN: v_cmp_nlt_f3242; GCN: s_and_saveexec_b6443; GCN-NEXT: s_endpgm44; GCN: .Lfunc_end45define amdgpu_kernel void @annotate_ret_noloop(ptr addrspace(1) noalias nocapture readonly %arg) #0 {46bb:47  %tmp = tail call i32 @llvm.amdgcn.workitem.id.x()48  br label %bb149 50bb1:                                              ; preds = %bb51  %tmp2 = sext i32 %tmp to i6452  %tmp3 = getelementptr inbounds <4 x float>, ptr addrspace(1) %arg, i64 %tmp253  %tmp4 = load <4 x float>, ptr addrspace(1) %tmp3, align 1654  %tmp5 = extractelement <4 x float> %tmp4, i32 155  store volatile <4 x float> %tmp4, ptr addrspace(1) poison56  %cmp = fcmp ogt float %tmp5, 1.057  br i1 %cmp, label %bb5, label %bb358 59bb3:                                              ; preds = %bb160  %tmp6 = extractelement <4 x float> %tmp4, i32 261  %tmp7 = fcmp olt float %tmp6, 0.000000e+0062  br i1 %tmp7, label %bb4, label %bb5 ; crash goes away if these are swapped63 64bb4:                                              ; preds = %bb365  ret void66 67bb5:                                              ; preds = %bb3, %bb168  ret void69}70 71; OPT-LABEL: @uniform_annotate_ret_noloop(72; OPT-NOT: call i1 @llvm.amdgcn.loop73 74; GCN-LABEL: {{^}}uniform_annotate_ret_noloop:75; GCN: s_cbranch_scc176; GCN: s_endpgm77; GCN: .Lfunc_end78define amdgpu_kernel void @uniform_annotate_ret_noloop(ptr addrspace(1) noalias nocapture readonly %arg, i32 %tmp) #0 {79bb:80  br label %bb181 82bb1:                                              ; preds = %bb83  %tmp2 = sext i32 %tmp to i6484  %tmp3 = getelementptr inbounds <4 x float>, ptr addrspace(1) %arg, i64 %tmp285  %tmp4 = load <4 x float>, ptr addrspace(1) %tmp3, align 1686  %undef = freeze i1 poison87  br i1 %undef, label %bb5, label %bb388 89bb3:                                              ; preds = %bb190  %tmp6 = extractelement <4 x float> %tmp4, i32 291  %tmp7 = fcmp olt float %tmp6, 0.000000e+0092  br i1 %tmp7, label %bb4, label %bb5 ; crash goes away if these are swapped93 94bb4:                                              ; preds = %bb395  ret void96 97bb5:                                              ; preds = %bb3, %bb198  ret void99}100 101 102declare i32 @llvm.amdgcn.workitem.id.x() #1103 104attributes #0 = { nounwind }105attributes #1 = { nounwind readnone }106