forked from OSchip/llvm-project
30eeb742f1
Add address space to indirect abi info and use it for kernels. Previously, indirect arguments assumed assumed a stack passed object in the alloca address space using byval. A stack pointer is unsuitable for kernel arguments, which are passed in a separate, constant buffer with a different address space. Start using the new byref for aggregate kernel arguments. Previously these were emitted as raw struct arguments, and turned into loads in the backend. These will lower identically, although with byref you now have the option of applying an explicit alignment. In the future, a reasonable implementation would use byref for all kernel arguments (this would be a practical problem at the moment due to losing things like noalias on pointer arguments). This is mostly to avoid fighting the optimizer's treatment of aggregate load/store. SROA and instcombine both turn aggregate loads and stores into a long sequence of element loads and stores, rather than the optimizable memcpy I would expect in this situation. Now an explicit memcpy will be introduced up-front which is better understood and helps eliminate the alloca in more situations. This skips using byref in the case where HIP kernel pointer arguments in structs are promoted to global pointers. At minimum an additional patch is needed to allow coercion with indirect arguments. This also skips using it for OpenCL due to the current workaround used to support kernels calling kernels. Distinct function bodies would need to be generated up front instead of emitting an illegal call. |
||
---|---|---|
.. | ||
2011-04-15-vec-init-from-vec.cl | ||
addr-space-struct-arg.cl | ||
address-space-constant-initializers.cl | ||
address-spaces-conversions.cl | ||
address-spaces-mangling.cl | ||
address-spaces.cl | ||
amdgcn-automatic-variable.cl | ||
amdgcn-flat-scratch-name.cl | ||
amdgcn-large-globals.cl | ||
amdgpu-abi-struct-coerce.cl | ||
amdgpu-alignment.cl | ||
amdgpu-attrs.cl | ||
amdgpu-call-kernel.cl | ||
amdgpu-calling-conv.cl | ||
amdgpu-debug-info-pointer-address-space.cl | ||
amdgpu-debug-info-variable-expression.cl | ||
amdgpu-enqueue-kernel.cl | ||
amdgpu-env-amdgcn.cl | ||
amdgpu-features.cl | ||
amdgpu-nullptr.cl | ||
amdgpu-sizeof-alignof.cl | ||
arm-integer-dot-product.cl | ||
as_type.cl | ||
atomic-ops-libcall.cl | ||
atomic-ops.cl | ||
backend-unsupported-warning.ll | ||
blocks.cl | ||
bool_cast.cl | ||
builtins-amdgcn-ci.cl | ||
builtins-amdgcn-dl-insts-err-clamp.cl | ||
builtins-amdgcn-dl-insts-err.cl | ||
builtins-amdgcn-dl-insts.cl | ||
builtins-amdgcn-gfx9.cl | ||
builtins-amdgcn-gfx10.cl | ||
builtins-amdgcn-interp.cl | ||
builtins-amdgcn-mfma.cl | ||
builtins-amdgcn-vi.cl | ||
builtins-amdgcn.cl | ||
builtins-f16.cl | ||
builtins-generic-amdgcn.cl | ||
builtins-r600.cl | ||
builtins.cl | ||
byval.cl | ||
cast_image.cl | ||
cl-strict-aliasing.cl | ||
cl-uniform-wg-size.cl | ||
cl20-device-side-enqueue.cl | ||
const-str-array-decay.cl | ||
constant-addr-space-globals.cl | ||
convergent.cl | ||
enqueue-kernel-non-entry-block.cl | ||
event_t.cl | ||
ext-int-shift.cl | ||
ext-vector-shuffle.cl | ||
extension-begin.cl | ||
fdeclare-opencl-builtins.cl | ||
fpmath.cl | ||
func-call-dbg-loc.cl | ||
half.cl | ||
images.cl | ||
inline-asm-amdgcn.cl | ||
intel-subgroups-avc-ext-types.cl | ||
kernel-arg-info-single-as.cl | ||
kernel-arg-info.cl | ||
kernel-attributes.cl | ||
kernel-metadata.cl | ||
kernels-have-spir-cc-by-default.cl | ||
lifetime.cl | ||
local-initializer-undef.cl | ||
local.cl | ||
logical-ops.cl | ||
memcpy.cl | ||
no-half.cl | ||
no-signed-zeros.cl | ||
norecurse.cl | ||
null_queue.cl | ||
numbered-address-space.cl | ||
opencl_types.cl | ||
overload.cl | ||
partial_initializer.cl | ||
pipe_builtin.cl | ||
pipe_types.cl | ||
pipe_types_mangling.cl | ||
preserve_vec3.cl | ||
printf.cl | ||
private-array-initialization.cl | ||
ptx-calls.cl | ||
ptx-kernels.cl | ||
relaxed-fpmath.cl | ||
sampler.cl | ||
shifts.cl | ||
single-precision-constant.cl | ||
size_t.cl | ||
spir-calling-conv.cl | ||
spir32_target.cl | ||
spir64_target.cl | ||
spir_version.cl | ||
str_literals.cl | ||
to_addr_builtin.cl | ||
unroll-hint.cl | ||
vectorLoadStore.cl | ||
vector_literals_valid.cl | ||
vector_logops.cl | ||
vector_odd.cl | ||
vector_shufflevector_valid.cl | ||
visibility.cl | ||
vla.cl |