This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Clamp min value of effective waves-per-eu instead of discarding
AbandonedPublic

Authored by arsenm on Feb 10 2022, 8:00 PM.

Details

Reviewers
kzhuravl
t-tye
rampitec
Group Reviewers
Restricted Project
Summary

If the flat work group size implied a larger minimum, this was
ignoring the requested maximum. This was interfering with the logic to
propagate amdgpu-waves-per-eu when accounting for the inferred flat
workgroup size. Just clamp the minimum so we still preserve the
requested maximum.

Plus I'm not really sure what the point of the minimum really is or
does. It is queried in a few IR passes (AMDGPUPromoteAlloca and TTI)
use it for getting a number of VGPRs, but everything else uses the
maximum.

No test here since I don't think this is a directly observable
property, but fixes a future patch which propagates
amdgpu-waves-per-eu.

Diff Detail

Event Timeline

arsenm created this revision.Feb 10 2022, 8:00 PM
arsenm requested review of this revision.Feb 10 2022, 8:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2022, 8:00 PM
Herald added a subscriber: wdng. · View Herald Transcript
foad added inline comments.Feb 11 2022, 12:11 AM
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
562–563

Just use std::max?

Looks like several tests have failed.

arsenm abandoned this revision.Jun 5 2023, 8:02 AM
arsenm marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 8:02 AM