1; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG %s 2 3; EG-LABEL: {{^}}read_workdim: 4; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] 5; EG: MOV * [[VAL]], KC0[2].Z 6define void @read_workdim(i32 addrspace(1)* %out) { 7entry: 8 %dim = call i32 @llvm.r600.read.workdim() #0 9 store i32 %dim, i32 addrspace(1)* %out 10 ret void 11} 12 13; EG-LABEL: {{^}}read_workdim_known_bits: 14define void @read_workdim_known_bits(i32 addrspace(1)* %out) { 15entry: 16 %dim = call i32 @llvm.r600.read.workdim() #0 17 %shl = shl i32 %dim, 24 18 %shr = lshr i32 %shl, 24 19 store i32 %shr, i32 addrspace(1)* %out 20 ret void 21} 22 23; EG-LABEL: {{^}}legacy_read_workdim: 24; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] 25; EG: MOV * [[VAL]], KC0[2].Z 26define void @legacy_read_workdim(i32 addrspace(1)* %out) { 27entry: 28 %dim = call i32 @llvm.AMDGPU.read.workdim() #0 29 store i32 %dim, i32 addrspace(1)* %out 30 ret void 31} 32 33declare i32 @llvm.r600.read.workdim() #0 34declare i32 @llvm.AMDGPU.read.workdim() #0 35 36attributes #0 = { nounwind readnone } 37