[all-commits] [llvm/llvm-project] 0bd1c8: [AMDGPU] Support divergent sized dynamic alloca (#...

Aaditya via All-commits all-commits at lists.llvm.org
Sun Jan 5 21:28:45 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0bd1c879966cfdf145b1f96292a2632628fab3fb
      https://github.com/llvm/llvm-project/commit/0bd1c879966cfdf145b1f96292a2632628fab3fb
  Author: Aaditya <115080342+easyonaadit at users.noreply.github.com>
  Date:   2025-01-06 (Mon, 06 Jan 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
    M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
    M llvm/lib/Target/AMDGPU/SIISelLowering.h
    R llvm/test/CodeGen/AMDGPU/GlobalISel/dynamic-alloca-divergent.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-dyn-stackalloc.mir
    M llvm/test/CodeGen/AMDGPU/dynamic_stackalloc.ll

  Log Message:
  -----------
  [AMDGPU] Support divergent sized dynamic alloca (#121148)

Currently, AMDGPU backend can handle uniform-sized dynamic allocas. 
This patch extends support for divergent-sized dynamic allocas.
When the size argument of a dynamic alloca is divergent, 
a wave-wide reduction is performed to get the required stack space. 
`@llvm.amdgcn.wave.reduce.umax` is used to perform the 
wave reduction.

Dynamic allocas are not completely supported yet, 
as the stack is not properly restored on function exit.
This patch doesn't attempt to address the aforementioned issue.

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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list