This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Simplify getReservedNumSGPRs
ClosedPublic

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

Details

Summary

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.

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
724–731

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.
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
732–735

The nested if can be merged into one.

optimize conditions

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
732–735

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.Jun 30 2021, 3:49 AM
This revision was automatically updated to reflect the committed changes.