This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Don't assume that fixed stack objects are aligned in a stack-realigned function.
ClosedPublic

Authored by cdavis5x on Mar 24 2016, 11:07 PM.

Details

Summary

After we make the adjustment, we can assume that for local allocas, but
not for stack parameters, the return address, or any other fixed stack
object (which has a negative offset and therefore lies prior to the
adjusted SP).

Fixes PR26662.

Diff Detail

Repository
rL LLVM

Event Timeline

cdavis5x updated this revision to Diff 51630.Mar 24 2016, 11:07 PM
cdavis5x retitled this revision from to [CodeGen] Don't assume that fixed stack objects are aligned in a stack-realigned function..
cdavis5x updated this object.
cdavis5x added reviewers: hfinkel, qcolombet.
cdavis5x added a subscriber: llvm-commits.
rnk accepted this revision.Apr 5 2016, 11:43 AM
rnk added a reviewer: rnk.
rnk added a subscriber: rnk.

lgtm

lib/CodeGen/MachineFunction.cpp
87–88 ↗(On Diff #51630)

As a separate issue, I noticed that StackRealignable and RealignOpt are redundant. We can get by with just StackRealignable, and making that be STI->getFrameLowering()->isStackRealignable() && F->hasFnAttribute("no-realign-stack").

This revision is now accepted and ready to land.Apr 5 2016, 11:43 AM
This revision was automatically updated to reflect the committed changes.
cdavis5x added inline comments.Apr 9 2016, 4:41 PM
lib/CodeGen/MachineFunction.cpp
87–88 ↗(On Diff #51630)

Yeah, but I think I'll save that for another patch.

rnk added inline comments.Apr 11 2016, 11:05 AM
lib/CodeGen/MachineFunction.cpp
87–88 ↗(On Diff #51630)

I went ahead and did this in r265971, it was more of an idle thought while staring at the related code. Thanks!