This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Support realigning stack
ClosedPublic

Authored by arsenm on Mar 29 2018, 8:42 AM.

Details

Reviewers
rampitec
t-tye
Summary

While the stack access instructions don't care about
alignment > 4, some transformations on the pointer calculation
do make assumptions based on knowing the low bits of a pointer
are 0. If a stack object ends up being accessed through its
absolute address (relative to the kernel scratch wave offset),
the addressing expression may depend on the stack frame being
properly aligned. This was breaking in a testcase due to the
add->or combine.

I think some of the SP/FP handling logic is still backwards,
and overly simplistic to support all of the stack features.
Code which tries to modify the SP with inline asm for example
or variable sized objects will probably require redoing this.

Diff Detail

Event Timeline

arsenm created this revision.Mar 29 2018, 8:42 AM
This revision is now accepted and ready to land.Mar 29 2018, 10:33 AM
arsenm closed this revision.Mar 29 2018, 2:48 PM

r328831