This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Improve register computation for indirect calls
ClosedPublic

Authored by sebastian-ne on Jul 12 2021, 1:05 PM.

Details

Summary

First, collect the register usage in each function, then apply the
maximum register usage of all functions to functions with indirect
calls.

This is more accurate than guessing the maximum register usage without
looking at the actual usage.

As before, assume that indirect calls will hit a function in the
current module.

Diff Detail

Event Timeline

sebastian-ne created this revision.Jul 12 2021, 1:05 PM
sebastian-ne requested review of this revision.Jul 12 2021, 1:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2021, 1:05 PM

friendly ping for review

madhur13490 added inline comments.Jul 19 2021, 6:22 AM
llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
11

Incorrect "the".

114–116

These can be computed only if there is indirect call. You can wrap it in a function and call to avoid clutter.

465

No need of newline.

473

No need of newline.

llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.h
11

Please be more verbose.

16

Incorrect inclusion header.

60

You make this as 'const' member function.

sebastian-ne marked 6 inline comments as done.

Fix review comments and rebase

arsenm accepted this revision.Jul 19 2021, 4:13 PM
This revision is now accepted and ready to land.Jul 19 2021, 4:13 PM
This revision was landed with ongoing or failed builds.Jul 20 2021, 5:00 AM
This revision was automatically updated to reflect the committed changes.