diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-08-20 00:01:21 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-08-20 00:01:21 +0000 |
commit | 220268d1772796501f73ff91a73939bfd1220526 (patch) | |
tree | 8530428dc41694678069b7a731b4924988de29a2 /libclc/r600 | |
parent | 458f80546857bfb908ebe64e754de7d7df1956db (diff) | |
download | llvm-220268d1772796501f73ff91a73939bfd1220526.zip llvm-220268d1772796501f73ff91a73939bfd1220526.tar.gz llvm-220268d1772796501f73ff91a73939bfd1220526.tar.bz2 |
amdgcn: Fix get_local_size IR return type
llvm-svn: 279350
Diffstat (limited to 'libclc/r600')
-rw-r--r-- | libclc/r600/lib/SOURCES | 1 | ||||
-rw-r--r-- | libclc/r600/lib/workitem/get_local_size.ll | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/libclc/r600/lib/SOURCES b/libclc/r600/lib/SOURCES index 33038f2..23da502 100644 --- a/libclc/r600/lib/SOURCES +++ b/libclc/r600/lib/SOURCES @@ -2,4 +2,5 @@ synchronization/barrier_impl.ll workitem/get_global_offset.cl workitem/get_group_id.cl workitem/get_local_id.cl +workitem/get_local_size.ll workitem/get_work_dim.cl diff --git a/libclc/r600/lib/workitem/get_local_size.ll b/libclc/r600/lib/workitem/get_local_size.ll new file mode 100644 index 0000000..136c9c6 --- /dev/null +++ b/libclc/r600/lib/workitem/get_local_size.ll @@ -0,0 +1,18 @@ +declare i32 @llvm.r600.read.local.size.x() nounwind readnone +declare i32 @llvm.r600.read.local.size.y() nounwind readnone +declare i32 @llvm.r600.read.local.size.z() nounwind readnone + +define i32 @get_local_size(i32 %dim) nounwind readnone alwaysinline { + switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim] +x_dim: + %x = call i32 @llvm.r600.read.local.size.x() + ret i32 %x +y_dim: + %y = call i32 @llvm.r600.read.local.size.y() + ret i32 %y +z_dim: + %z = call i32 @llvm.r600.read.local.size.z() + ret i32 %z +default: + unreachable +} |