llvm.org GIT mirror llvm / c335b4b
Add test case for the regression caused by r344696 (That change has since been reverted.) Reduced from https://bugs.freedesktop.org/show_bug.cgi?id=108611 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346423 91177308-0d34-0410-b5e6-96231b3b80d8 Nicolai Haehnle 1 year, 4 months ago
1 changed file(s) with 24 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
614614 }
615615
616616
617 ; This test checks that the load after some control flow with an offset based
618 ; on a divergent shader input is correctly recognized as divergent. This was
619 ; reduced from an actual regression. Yes, the %unused argument matters, as
620 ; well as the fact that %arg4 is a vector.
621 ;
622 ; GCN-LABEL: {{^}}arg_divergence:
623 ; GCN: buffer_load_dword v0, v0,
624 ; GCN-NEXT: s_waitcnt
625 ; GCN-NEXT: ; return to shader part epilog
626 define amdgpu_cs float @arg_divergence(i32 inreg %unused, <3 x i32> %arg4) #0 {
627 main_body:
628 br i1 undef, label %if1, label %endif1
629
630 if1: ; preds = %main_body
631 store i32 0, i32 addrspace(3)* undef, align 4
632 br label %endif1
633
634 endif1: ; preds = %if1, %main_body
635 %tmp13 = extractelement <3 x i32> %arg4, i32 0
636 %tmp97 = call float @llvm.SI.load.const.v4i32(<4 x i32> undef, i32 %tmp13)
637 ret float %tmp97
638 }
639
640
617641 declare void @llvm.amdgcn.exp.f32(i32, i32, float, float, float, float, i1, i1) #0
618642 declare float @llvm.SI.load.const.v4i32(<4 x i32>, i32) #1
619643 declare float @llvm.amdgcn.interp.p1(float, i32, i32, i32) #2