[all-commits] [llvm/llvm-project] cf188d: [AMDGPU] Avoid crashes for non-byte-sized types in...

Fabian Ritter via All-commits all-commits at lists.llvm.org
Mon Apr 14 00:14:15 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cf188d650ce26b4ee3e11101d844361fca15ba64
      https://github.com/llvm/llvm-project/commit/cf188d650ce26b4ee3e11101d844361fca15ba64
  Author: Fabian Ritter <fabian.ritter at amd.com>
  Date:   2025-04-14 (Mon, 14 Apr 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
    A llvm/test/CodeGen/AMDGPU/promote-alloca-non-byte-sizes.ll

  Log Message:
  -----------
  [AMDGPU] Avoid crashes for non-byte-sized types in PromoteAlloca (#134042)

This patch addresses three problems when promoting allocas to vectors:
- Element types with size < 1 byte in allocas with a vector type caused
  divisions by zero.
- Element types whose size doesn't match their AllocSize hit an assertion.
- Access types whose size doesn't match their AllocSize hit an assertion.

With this patch, we do not attempt to promote affected allocas to vectors. In
principle, we could handle these cases in PromoteAlloca, e.g., by truncating
and extending elements from/to their allocation size. It's however unclear if
we ever encounter such cases in practice, so that doesn't seem worth the added
complexity.

For SWDEV-511252



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