This is an archive of the discontinued LLVM Phabricator instance.

Use methods to access data stored with frame instructions
ClosedPublic

Authored by sepavloff on Apr 11 2017, 11:22 AM.

Details

Summary

Instructions CALLSEQ_START..CALLSEQ_END and their target dependent
counterparts keep data like frame size, stack adjustment etc. These
data are accessed by getOperand using hard coded indices. It is
error prone way. This change implements the access by special methods,
which improve readability and allow changing data representation without
massive changes of index values.
This patch is essentially NFC, it is needed to simplify subsequent changes.

Diff Detail

Repository
rL LLVM

Event Timeline

sepavloff created this revision.Apr 11 2017, 11:22 AM
mkuper accepted this revision.Apr 12 2017, 10:44 AM

LGTM, except for the comments.

include/llvm/Target/TargetInstrInfo.h
170 ↗(On Diff #94864)

This sentence is somewhat broken.

lib/Target/X86/X86InstrInfo.h
185 ↗(On Diff #94864)

This doesn't sound right. IIRC, the second parameter is precisely the adjustment this instruction is *not* responsible for.
That is, the first parameter is "how much is the frame getting adjusted by, overall", and the second parameter is "how much of the adjustment happens inside the sequence" (e.g. by pushes, or inside the callee).

This revision is now accepted and ready to land.Apr 12 2017, 10:44 AM
sepavloff updated this revision to Diff 95111.Apr 13 2017, 5:44 AM

Updated comments

Thank you.
I changed the comments, hope they become clearer.

This revision was automatically updated to reflect the committed changes.