- Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target.
- Use function attribute to communicate to the AMDGPU backend to add implicit arguments for OpenCL kernels for the AMDHSA OS.
Details
Diff Detail
Event Timeline
include/llvm/ADT/Triple.h | ||
---|---|---|
205 | This isn't related to this. This was used in the x86 OpenCL implementation to change some lib calls I believe | |
lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
214–217 | The naming of this is wrong. We don't want to specify the language, I thought the point of this was to specify the size of the kernel segment, so this would have a value and not be a bool indicating a source language |
- Changed to use function attribute that specifies the number of bytes of implicit arguments for OpenCL kernels when using the AMDHSA OS.
lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
548 | You don't need this separate check for the attribute existing. getIntegerAttribute essentially does this for you |
lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
548–549 | Is there a maximum value we could default this to instead of 0? I'm a bit worried that if this attribute is missing or mis-specified the program will be broken, i.e. this attribute could only reduce the amount used |
Address review feedback.
Add OpenCL implicit argument description.
Remove unused hcc target triple environment.
lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
548–549 | I don't see how what hcc wants is related? What is the maximum value this could be? In general attributes should make things less conservative, not more |
lib/Target/AMDGPU/AMDGPUSubtarget.h | ||
---|---|---|
548–549 | If a language runtime does not need any implicit arguments why would we want to add some space for arguments that are never used? The original code never added implicit arguments unless it was being explicitly requested. Conceptually the maximum number is maxint since a different runtime/OS ABI may want a different set of implicit arguments. |
This isn't related to this. This was used in the x86 OpenCL implementation to change some lib calls I believe