Skip to content

Conversation

@easyonaadit
Copy link
Contributor

@easyonaadit easyonaadit commented Dec 24, 2024

Currently, AMDGPU backend supports static sized allocas.
This patch extends support for truly dynamic sized allocas.
The value representing dynamic alloca size can be divergent
which needs a wave-wide reduction to get the stack space.
@llvm.amdgcn.wave.reduce.umax is used to perform the
wave reduction.

Note: Compiler already Zero-Extends or Truncates all other
types(of alloca size arg) to i32.

@nikic nikic changed the title Support dynamically sized allocas [AMDGPU] Support dynamically sized allocas Dec 24, 2024
@easyonaadit easyonaadit force-pushed the support-dynamically-sized-allocas branch from 93c0a23 to f4001d4 Compare December 26, 2024 07:44
@easyonaadit easyonaadit force-pushed the support-dynamically-sized-allocas branch 2 times, most recently from 435d293 to 6046b57 Compare December 26, 2024 10:03
Currently, AMDGPU backend supports static sized allocas.
This patch extends support for truly dynamic sized allocas.
The value representing dynamic alloca size can be divergent
which needs a wave-wide reduction to get the stack space.
@llvm.amdgcn.wave.reduce.umax is used to perform the
wave reduction.

Note: Compiler already Zero-Extends or Truncates all other
types(of alloca size arg) to i32.
@easyonaadit easyonaadit force-pushed the support-dynamically-sized-allocas branch from 6046b57 to 37dcbcc Compare December 26, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant