This is an archive of the discontinued LLVM Phabricator instance.

[HIP][AMDGPU] Do not perform Promote Alloca optimization for GPU kernels with dynamic LDS usage.
Needs ReviewPublic

Authored by kpyzhov on Jun 22 2020, 6:22 PM.

Details

Summary

The "Promote Alloca" optimization tries to move some stack allocations to statically allocated LDS, so it adds new static LDS loads/stores to the kernel.
Mixed static/dynamic LDS is not correctly supported by the hip-clang yet, so adding static LDS load/stores to a kernel that already has dynamic LDS operations causes conflicts.
This patch disables Promote Alloca optimization for kernels that use dynamic LDS.

Diff Detail

Event Timeline

kpyzhov created this revision.Jun 22 2020, 6:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 22 2020, 6:22 PM
arsenm requested changes to this revision.Jun 23 2020, 5:33 AM

Needs testcase

llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
740

I think this needs more clarification, since this does handle dynamic LDS as OpenCL uses it through a kernel argument.

This revision now requires changes to proceed.Jun 23 2020, 5:33 AM

inverse ping

arsenm resigned from this revision.Jan 4 2023, 11:28 AM

This can be abandoned, we now handle this

This revision now requires review to proceed.Jan 4 2023, 11:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 11:28 AM
Herald added subscribers: kosarev, foad. · View Herald Transcript