This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Set flat_scratch from flat_scratch_init reg
ClosedPublic

Authored by arsenm on Feb 9 2016, 1:42 PM.

Details

Reviewers
tstellarAMD
Summary

This was hardcoded to the static private size, but this
would be missing the offset and additional size for someday
when we have dynamic sizing.

Also stops always initializing flat_scratch even when unused.

In the future we should stop emitting this unless flat instructions
are used to access private memory. For example this will initialize
it almost always on VI because flat is used for global access.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 47359.Feb 9 2016, 1:42 PM
arsenm retitled this revision from to AMDGPU: Set flat_scratch from flat_scratch_init reg.
arsenm updated this object.
arsenm added a reviewer: tstellarAMD.
arsenm added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Feb 10 2016, 6:03 PM
tstellarAMD edited edge metadata.

LGTM.

lib/Target/AMDGPU/SIFrameLowering.cpp
78

I'm not sure if this comment was intentional, but I think this should be dropped.

This revision is now accepted and ready to land.Feb 10 2016, 6:03 PM
arsenm closed this revision.Feb 11 2016, 10:36 PM

r260658

lib/Target/AMDGPU/SIFrameLowering.cpp
78

The condition should be there, but right now it doesn't do anything because flat instructions are detected in SILowerControlFlow