This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Improve frame index folding for pre-allocated objects
AbandonedPublic

Authored by arsenm on Nov 21 2016, 1:40 PM.

Details

Reviewers
tstellarAMD
Summary

If the LocalStackSlotAlloction pass has already fixed the offset
for the object during operand folding, check if the offset is an
inline immediate.

There are a couple remaining issues separate from this patch
that need to be corrected before this can be committed.
LocalStackSlotAlloctation decides if it didn't need to put any
frame base registers in that it shouldn't create the pre-allocated
area, so no offsets are known.

Additionally there are code regressions when the base frame index
is folded into an instruction at the expensive of the offset.
e.g. an add fi, offset folds the frame index instead of the single
use offset, instead of materializing the frame index which is re-used
in multiple instructions.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 78774.Nov 21 2016, 1:40 PM
arsenm retitled this revision from to AMDGPU: Improve frame index folding for pre-allocated objects.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
tstellarAMD accepted this revision.Nov 23 2016, 12:41 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Nov 23 2016, 12:41 PM
t-tye added a subscriber: t-tye.Mar 22 2017, 6:38 PM
tony-tye removed a subscriber: tony-tye.Mar 22 2017, 6:50 PM
arsenm abandoned this revision.Mar 31 2017, 11:23 AM

I think this isn't necessarily correct. I don't think the local frame object is at offset 0