[all-commits] [llvm/llvm-project] 6b1b6b: [AMDGPU][Attributor] Fix the merge of two range st...

Shilei Tian via All-commits all-commits at lists.llvm.org
Wed Feb 5 09:36:18 PST 2025


  Branch: refs/heads/users/shiltian/new-range-for-flat-wgrp-size-and-waves-per-eu
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b1b6bbbc7ab38d10aa24339cf367f9e5988201b
      https://github.com/llvm/llvm-project/commit/6b1b6bbbc7ab38d10aa24339cf367f9e5988201b
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2025-02-05 (Wed, 05 Feb 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
    M llvm/test/CodeGen/AMDGPU/propagate-flat-work-group-size.ll

  Log Message:
  -----------
  [AMDGPU][Attributor] Fix the merge of two range states of flat workgroup size

This PR updates the logic for merging two flat workgroup size pairs. The current
implementation, which uses `clampStateAndIndicateChange` to compute a union, is
not ideal. If we think from ensure proper resource allocation perspective, for
instance, if one pair specifies a minimum of 32 flat workgroup size, and another
specifies a minimum of 64, we should guarantee that 64 flat workgroup size can
be supported, as failing to do so could result in excessive resource allocation.
A similar principle applies to the upper bound. Thus, the PR uses the following
approach for merging two pairs,

`lo_a,up_a and lo_b,up_b: max(lo_a, lo_b), max(up_a, up_b)`.

This ensures that resource allocation adheres to the stricter constraints from
both inputs.

This PR only updates the merge for `AAAMDFlatWorkGroupSize`. `AAAMDWavesPerEU`
will be rewritten in a follow-up.



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