[PATCH] D21427: NFC; refactor getFrameIndexReferenceFromSP

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 23:11:02 PDT 2016


sanjoy created this revision.
sanjoy added a reviewer: rnk.
sanjoy added a subscriber: llvm-commits.
Herald added subscribers: mcrosier, sanjoy.

... into getFrameIndexReferencePreferSP.  This change folds the
fail-then-retry logic into getFrameIndexReferencePreferSP.

There is a non-functional but behaviorial change in WinException --
earlier if `getFrameIndexReferenceFromSP` failed we'd trip an assert,
but now we'll silently use the (wrong) offset from the base pointer.  I
could not write the assert I'd like to write ("FrameReg ==
StackRegister", like I've done in X86FrameLowering) since there is no
easy way to get to the stack register from WinException (happy to be
proven wrong here).  One solution to this is to add a `bool
OnlyStackPointer` parameter to `getFrameIndexReferenceFromSP` that
asserts if it could not satisfy its promise of returning an offset from
a stack pointer, but that seems overkill.

http://reviews.llvm.org/D21427

Files:
  include/llvm/Target/TargetFrameLowering.h
  lib/CodeGen/AsmPrinter/WinException.cpp
  lib/CodeGen/PrologEpilogInserter.cpp
  lib/Target/X86/X86FrameLowering.cpp
  lib/Target/X86/X86FrameLowering.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21427.60948.patch
Type: text/x-patch
Size: 7088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160616/fcd505d2/attachment.bin>


More information about the llvm-commits mailing list