This is an archive of the discontinued LLVM Phabricator instance.

X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC
ClosedPublic

Authored by MatzeB on Apr 18 2017, 5:31 PM.

Details

Summary

X86RegisterInfo::eliminateFrameIndex() and
X86FrameLowering::getFrameIndexReference() both had logic to compute the
base register. This consolidates the code.

Also use MachineInstr::isReturn instead of manually enumerating tail
call instructions (return instructions were not included in the previous
list because they never reference frame indexes).

Diff Detail

Repository
rL LLVM

Event Timeline

MatzeB created this revision.Apr 18 2017, 5:31 PM
rnk accepted this revision.Apr 18 2017, 6:18 PM

lgtm

lib/Target/X86/X86RegisterInfo.cpp
676 ↗(On Diff #95663)

I guess conditional tail calls don't have memory operands. You can't conditionally jump to the pointer in a memory location.

This revision is now accepted and ready to land.Apr 18 2017, 6:18 PM
MatzeB updated this revision to Diff 95863.Apr 19 2017, 5:19 PM

Add assert() to be in line with the latest update in D32205

This revision was automatically updated to reflect the committed changes.