This is an archive of the discontinued LLVM Phabricator instance.

AMDGPUPerfHintAnalysis: don't treat constant loads as large stride
AcceptedPublic

Authored by foad on Jul 13 2020, 6:13 AM.

Details

Summary

In the "large stride" heuristic ignore loads from the constant address
space (as well as local address space). K$ behavior is very different
from L0$ so it doesn't make much sense to use the same heuristic for
them.

Diff Detail

Event Timeline

foad created this revision.Jul 13 2020, 6:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2020, 6:13 AM

LGTM, but needs a test.

foad updated this revision to Diff 278156.Jul 15 2020, 5:29 AM

Add a test case.

rampitec accepted this revision.Jul 15 2020, 11:45 AM

This is LGTM, but needs test fix first of course.

This revision is now accepted and ready to land.Jul 15 2020, 11:45 AM

Typo Perh in commit message

foad retitled this revision from AMDGPUPerhHintAnalysis: don't treat constant loads as large stride to AMDGPUPerfHintAnalysis: don't treat constant loads as large stride.Jul 15 2020, 11:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 31 2022, 5:56 AM
Herald added a subscriber: hsmhsm. · View Herald Transcript
arsenm added inline comments.Mar 31 2022, 5:59 AM
llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp
345–346

This isn't really a good implementation. We use scalar loads in more cases and constant address space isn't a guarantee of SMEM loads

foad added a comment.Apr 1 2022, 5:54 AM

This is LGTM, but needs test fix first of course.

I think the test is OK now I have rebased on D122804?

arsenm accepted this revision.Apr 5 2022, 5:48 PM

LGTM I guess, but isConstantAddr really should be fixed. CONSTANT_ADDRESS isn't sufficient or even that helpful for knowing if this will use scalar loads