[PATCH] D20299: AMDGPU: Export target workitem related builtins
Jan Vesely via llvm-commits
llvm-commits at lists.llvm.org
Sun May 22 16:47:15 PDT 2016
jvesely marked an inline comment as done.
================
Comment at: include/clang/Basic/BuiltinsAMDGPU.def:73
@@ +72,3 @@
+
+BUILTIN(__builtin_r600_read_workdim, "Ui", "nc")
+
----------------
sorry, it was kind of hard to parse, I mentioned LANGBUILTIN as a possible alternative.
another alternative is to have clc specific builtins, e.g
```
__builtin_clc_get_work_dim()
__builtin_clc_get_global_offset(int)
...
```
and implement them for every target
================
Comment at: test/CodeGenOpenCL/builtins-amdgcn.cl:280
@@ +279,3 @@
+// CHECK-LABEL: @test_get_group_id(
+// CHECK: tail call i32 @llvm.amdgcn.workgroup.id.x()
+// CHECK: tail call i32 @llvm.amdgcn.workgroup.id.y()
----------------
range metadata is not generated.
if I understand the code correctly, we'd need to drop __builtin names from
> include/llvm/IR/IntrinsicsAMDGPU.td
and emit each intrinsic manually in
> lib/CodeGen/CGBuiltin.cpp
with added range metadata.
I can take a look but I think it should be a separate patch
Repository:
rL LLVM
http://reviews.llvm.org/D20299
More information about the llvm-commits
mailing list