[PATCH] Implement the x86 lowering for inalloca

Reid Kleckner rnk at google.com
Thu Dec 19 18:52:59 PST 2013


Hi sunfish,

This implements inalloca lowering in SelectionDAGBuilder, which is
target independent.  The core idea is to move the frame adjustment from
the CALLSEQ_START node to a dominating DYNAMIC_STACKALLOC and let the
frontend emit stackrestore calls to clear the stack when necessary.

With the current rules for inalloca, the last inalloca argument must
dominate the rest.  For simplicity, I emit code for all inalloca
arguments for a call at the site of the last inalloca alloca.

I added a new target hook, AnalyzeCallArgs, which is split from
LowerCallTo.  It exposes the argument frame size and the locations of
all the arguments to the SD builder.  With that, I can create an
appopriately sized DYNAMIC_STACKALLOC and set the virtual result
registers for the allocas to the appropriate stack offsets.

Depends On: D2449

http://llvm-reviews.chandlerc.com/D2450

Files:
  include/llvm/Target/TargetCallingConv.h
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/Mangler.cpp
  lib/Target/X86/X86FastISel.cpp
  lib/Target/X86/X86FrameLowering.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/inalloca-ctor.ll
  test/CodeGen/X86/inalloca-stdcall.ll
  test/CodeGen/X86/inalloca.ll
  test/CodeGen/X86/inalloca2.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2450.1.patch
Type: text/x-patch
Size: 38202 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131219/703d59a6/attachment.bin>


More information about the llvm-commits mailing list