3 ; RUN: llc -O0 -verify-machineinstrs -asm-verbose=0 -march=amdgcn -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=COMMON %s
4 ; RUN: llc -O0 -verify-machineinstrs -asm-verbose=0 -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=SI -check-prefix=COMMON %s
5 ; RUN: llc -O0 -verify-machineinstrs -asm-verbose=0 -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=COMMON %s
7 ; SI hits an assertion at -O0, evergreen hits a not implemented unreachable.
9 ; COMMON-LABEL: {{^}}branch_true:
10 define void @branch_true(i8 addrspace(1)* nocapture %main, i32 %main_stride) #0 {
12 br i1 true, label %for.end, label %for.body.lr.ph
14 for.body.lr.ph: ; preds = %entry
15 %add.ptr.sum = shl i32 %main_stride, 1
16 %add.ptr1.sum = add i32 %add.ptr.sum, %main_stride
17 %add.ptr4.sum = shl i32 %main_stride, 2
20 for.body: ; preds = %for.body, %for.body.lr.ph
21 %main.addr.011 = phi i8 addrspace(1)* [ %main, %for.body.lr.ph ], [ %add.ptr6, %for.body ]
22 %0 = bitcast i8 addrspace(1)* %main.addr.011 to i32 addrspace(1)*
23 %1 = load i32, i32 addrspace(1)* %0, align 4
24 %add.ptr = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %main_stride
25 %2 = bitcast i8 addrspace(1)* %add.ptr to i32 addrspace(1)*
26 %3 = load i32, i32 addrspace(1)* %2, align 4
27 %add.ptr1 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr.sum
28 %4 = bitcast i8 addrspace(1)* %add.ptr1 to i32 addrspace(1)*
29 %5 = load i32, i32 addrspace(1)* %4, align 4
30 %add.ptr2 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr1.sum
31 %6 = bitcast i8 addrspace(1)* %add.ptr2 to i32 addrspace(1)*
32 %7 = load i32, i32 addrspace(1)* %6, align 4
33 %add.ptr3 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr4.sum
34 %8 = bitcast i8 addrspace(1)* %add.ptr3 to i32 addrspace(1)*
35 %9 = load i32, i32 addrspace(1)* %8, align 4
36 %add.ptr6 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 undef
37 br i1 undef, label %for.end, label %for.body
39 for.end: ; preds = %for.body, %entry
43 ; COMMON-LABEL: {{^}}branch_false:
46 define void @branch_false(i8 addrspace(1)* nocapture %main, i32 %main_stride) #0 {
48 br i1 false, label %for.end, label %for.body.lr.ph
50 for.body.lr.ph: ; preds = %entry
51 %add.ptr.sum = shl i32 %main_stride, 1
52 %add.ptr1.sum = add i32 %add.ptr.sum, %main_stride
53 %add.ptr4.sum = shl i32 %main_stride, 2
56 for.body: ; preds = %for.body, %for.body.lr.ph
57 %main.addr.011 = phi i8 addrspace(1)* [ %main, %for.body.lr.ph ], [ %add.ptr6, %for.body ]
58 %0 = bitcast i8 addrspace(1)* %main.addr.011 to i32 addrspace(1)*
59 %1 = load i32, i32 addrspace(1)* %0, align 4
60 %add.ptr = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %main_stride
61 %2 = bitcast i8 addrspace(1)* %add.ptr to i32 addrspace(1)*
62 %3 = load i32, i32 addrspace(1)* %2, align 4
63 %add.ptr1 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr.sum
64 %4 = bitcast i8 addrspace(1)* %add.ptr1 to i32 addrspace(1)*
65 %5 = load i32, i32 addrspace(1)* %4, align 4
66 %add.ptr2 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr1.sum
67 %6 = bitcast i8 addrspace(1)* %add.ptr2 to i32 addrspace(1)*
68 %7 = load i32, i32 addrspace(1)* %6, align 4
69 %add.ptr3 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr4.sum
70 %8 = bitcast i8 addrspace(1)* %add.ptr3 to i32 addrspace(1)*
71 %9 = load i32, i32 addrspace(1)* %8, align 4
72 %add.ptr6 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 undef
73 br i1 undef, label %for.end, label %for.body
75 for.end: ; preds = %for.body, %entry
79 ; COMMON-LABEL: {{^}}branch_undef:
82 define void @branch_undef(i8 addrspace(1)* nocapture %main, i32 %main_stride) #0 {
84 br i1 undef, label %for.end, label %for.body.lr.ph
86 for.body.lr.ph: ; preds = %entry
87 %add.ptr.sum = shl i32 %main_stride, 1
88 %add.ptr1.sum = add i32 %add.ptr.sum, %main_stride
89 %add.ptr4.sum = shl i32 %main_stride, 2
92 for.body: ; preds = %for.body, %for.body.lr.ph
93 %main.addr.011 = phi i8 addrspace(1)* [ %main, %for.body.lr.ph ], [ %add.ptr6, %for.body ]
94 %0 = bitcast i8 addrspace(1)* %main.addr.011 to i32 addrspace(1)*
95 %1 = load i32, i32 addrspace(1)* %0, align 4
96 %add.ptr = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %main_stride
97 %2 = bitcast i8 addrspace(1)* %add.ptr to i32 addrspace(1)*
98 %3 = load i32, i32 addrspace(1)* %2, align 4
99 %add.ptr1 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr.sum
100 %4 = bitcast i8 addrspace(1)* %add.ptr1 to i32 addrspace(1)*
101 %5 = load i32, i32 addrspace(1)* %4, align 4
102 %add.ptr2 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr1.sum
103 %6 = bitcast i8 addrspace(1)* %add.ptr2 to i32 addrspace(1)*
104 %7 = load i32, i32 addrspace(1)* %6, align 4
105 %add.ptr3 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 %add.ptr4.sum
106 %8 = bitcast i8 addrspace(1)* %add.ptr3 to i32 addrspace(1)*
107 %9 = load i32, i32 addrspace(1)* %8, align 4
108 %add.ptr6 = getelementptr inbounds i8, i8 addrspace(1)* %main.addr.011, i32 undef
109 br i1 undef, label %for.end, label %for.body
111 for.end: ; preds = %for.body, %entry
115 attributes #0 = { nounwind }