This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Figure out private memory regs after lowering
ClosedPublic

Authored by arsenm on Jul 12 2017, 9:04 PM.

Details

Summary

Introduce pseudo-registers for registers needed for stack
access, which are replaced during finalizeLowering.
Note these pseudo-registers are currently only used for the
used register location, and not for determining their
input argument register.

This is better because it avoids the need to try to predict
whether a call will be emitted from the IR, and also
detects stack objects introduced by legalization.

Test changes are from the HasStackObjects check being more
accurate since stack objects introduced during legalization
are now known.

Diff Detail

Event Timeline

arsenm created this revision.Jul 12 2017, 9:04 PM
rampitec added inline comments.Jul 13 2017, 12:37 AM
lib/Target/AMDGPU/SIISelLowering.cpp
5720

If we are lowering starting from the leafs cannot we check if calls actually require an SP? Do not we have a CG?

arsenm added inline comments.Jul 13 2017, 8:37 AM
lib/Target/AMDGPU/SIISelLowering.cpp
5720

The details of the call graph aren't important for this. I've been assuming any call requires stack access. Try to interprocedurally remove that would add too much complexity at this stage for not much benefit.

The call checks and all the SP handling here are dead code here since most of the call work isn't upstream yet.

This revision is now accepted and ready to land.Jul 14 2017, 3:41 PM
arsenm closed this revision.Jul 18 2017, 9:45 AM

r308325