1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker; Normally icmp + select is optimized to select_cc, when this happens the 5*9880d681SAndroid Build Coastguard Worker; DAGLegalizer never sees the select and doesn't have a chance to leaglize it. 6*9880d681SAndroid Build Coastguard Worker; 7*9880d681SAndroid Build Coastguard Worker; In order to avoid the select_cc optimization, this test case calculates the 8*9880d681SAndroid Build Coastguard Worker; condition for the select in a separate basic block. 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}select: 11*9880d681SAndroid Build Coastguard Worker; EG-DAG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.X 12*9880d681SAndroid Build Coastguard Worker; EG-DAG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.X 13*9880d681SAndroid Build Coastguard Worker; EG-DAG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.XY 14*9880d681SAndroid Build Coastguard Worker; EG-DAG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.XY 15*9880d681SAndroid Build Coastguard Worker; EG-DAG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.XYZW 16*9880d681SAndroid Build Coastguard Worker; EG-DAG: MEM_RAT_CACHELESS STORE_RAW T{{[0-9]+}}.XYZW 17*9880d681SAndroid Build Coastguard Workerdefine void @select (i32 addrspace(1)* %i32out, float addrspace(1)* %f32out, 18*9880d681SAndroid Build Coastguard Worker <2 x i32> addrspace(1)* %v2i32out, <2 x float> addrspace(1)* %v2f32out, 19*9880d681SAndroid Build Coastguard Worker <4 x i32> addrspace(1)* %v4i32out, <4 x float> addrspace(1)* %v4f32out, 20*9880d681SAndroid Build Coastguard Worker i32 %cond) { 21*9880d681SAndroid Build Coastguard Workerentry: 22*9880d681SAndroid Build Coastguard Worker br label %for 23*9880d681SAndroid Build Coastguard Workerbody: 24*9880d681SAndroid Build Coastguard Worker %inc = add i32 %i, 1 25*9880d681SAndroid Build Coastguard Worker %br_cmp.i = icmp eq i1 %br_cmp, 0 26*9880d681SAndroid Build Coastguard Worker br label %for 27*9880d681SAndroid Build Coastguard Workerfor: 28*9880d681SAndroid Build Coastguard Worker %i = phi i32 [ %inc, %body], [ 0, %entry ] 29*9880d681SAndroid Build Coastguard Worker %br_cmp = phi i1 [ %br_cmp.i, %body ], [ 0, %entry ] 30*9880d681SAndroid Build Coastguard Worker %0 = icmp eq i32 %cond, %i 31*9880d681SAndroid Build Coastguard Worker %1 = select i1 %br_cmp, i32 2, i32 3 32*9880d681SAndroid Build Coastguard Worker %2 = select i1 %br_cmp, float 2.0 , float 5.0 33*9880d681SAndroid Build Coastguard Worker %3 = select i1 %br_cmp, <2 x i32> <i32 2, i32 3>, <2 x i32> <i32 4, i32 5> 34*9880d681SAndroid Build Coastguard Worker %4 = select i1 %br_cmp, <2 x float> <float 2.0, float 3.0>, <2 x float> <float 4.0, float 5.0> 35*9880d681SAndroid Build Coastguard Worker %5 = select i1 %br_cmp, <4 x i32> <i32 2 , i32 3, i32 4, i32 5>, <4 x i32> <i32 6, i32 7, i32 8, i32 9> 36*9880d681SAndroid Build Coastguard Worker %6 = select i1 %br_cmp, <4 x float> <float 2.0, float 3.0, float 4.0, float 5.0>, <4 x float> <float 6.0, float 7.0, float 8.0, float 9.0> 37*9880d681SAndroid Build Coastguard Worker br i1 %0, label %body, label %done 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Workerdone: 40*9880d681SAndroid Build Coastguard Worker store i32 %1, i32 addrspace(1)* %i32out 41*9880d681SAndroid Build Coastguard Worker store float %2, float addrspace(1)* %f32out 42*9880d681SAndroid Build Coastguard Worker store <2 x i32> %3, <2 x i32> addrspace(1)* %v2i32out 43*9880d681SAndroid Build Coastguard Worker store <2 x float> %4, <2 x float> addrspace(1)* %v2f32out 44*9880d681SAndroid Build Coastguard Worker store <4 x i32> %5, <4 x i32> addrspace(1)* %v4i32out 45*9880d681SAndroid Build Coastguard Worker store <4 x float> %6, <4 x float> addrspace(1)* %v4f32out 46*9880d681SAndroid Build Coastguard Worker ret void 47*9880d681SAndroid Build Coastguard Worker} 48