[PATCH] D30052: [X86] Emit fewer instructions to allocate >16GB stack frames

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 13:11:06 PST 2017


rnk created this revision.

Use this code pattern when RAX is live, instead of emitting up to 2
billion adjustments:

  pushq %rax
  movabsq $Offset, %rax
  addq/subq %rsp, %rax
  xchg %rax, (%rsp)
  movq (%rsp), %rsp

Try to clean this code up a bit while I'm here. In particular, hoist the
logic that handles the entire adjustment with `movabsq $imm, %rax` out
of the loop.

Fixes PR31962


https://reviews.llvm.org/D30052

Files:
  lib/Target/X86/X86FrameLowering.cpp
  test/CodeGen/X86/huge-stack-offset2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30052.88772.patch
Type: text/x-patch
Size: 7505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170216/69f1975d/attachment.bin>


More information about the llvm-commits mailing list