Page MenuHomePhabricator

[AMDGPU] Simplify getReservedNumSGPRs

Authored by madhur13490 on Jun 18 2021, 2:45 AM.



This is a followup patch on D103636 where
it seemed checking on amdgpu-calls and
amdgpu-stack-objects is unnecessary. Removing these
checks didn't regress any tests functionally.

Diff Detail

Event Timeline

madhur13490 created this revision.Jun 18 2021, 2:45 AM
madhur13490 requested review of this revision.Jun 18 2021, 2:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 18 2021, 2:45 AM
foad added a subscriber: Flakebi.

Adding @Flakebi for awareness.


This comment is no longer true. SIMachineFunctionInfo.cpp:169 still tests HasCalls and HasStackObjects.

address review comments

madhur13490 marked an inline comment as done.Jun 21 2021, 11:35 PM

Ping to @arsenm

sebastian-ne added inline comments.

The nested if can be merged into one.

optimize conditions


Actually optimizing it a bit more, checking isAmdHsaOrMesa() is nugatory here. Setting the flag requires enableFlatScratch() to be true always.

arsenm accepted this revision.Jun 28 2021, 7:03 AM
This revision is now accepted and ready to land.Jun 28 2021, 7:03 AM
This revision was landed with ongoing or failed builds.Wed, Jun 30, 3:49 AM
This revision was automatically updated to reflect the committed changes.