[PATCH] [Statepoints] Reuse stack slots for assignment idioms

Philip Reames listmail at philipreames.com
Thu Jun 11 14:19:10 PDT 2015


Hi igor-laevsky, sanjoy, pgavlin,

Reading over @Igor's changes in 239472, it hit me that the same scheme could be easily extended to implement one of the existing TODOs in the lowering code.

If we have an idiom that looks like assignment (i.e. a new SSA value produced from some operation where it's input is no longer used), we can reuse the stack slot of the original SSA value for the updated value.  This works really nicely for GEPs on x86 because we can use an update directly against the stack slot and avoid a fill, modify, spill pattern entirely.

It doesn't work quite as cleanly for deoptimization arguments, mostly because the original spill slot is not reused for the update.  I suspect this might be because we're marking the slot as being updated by the previous statepoint, but I decided to separate that into a separate patch.  We at least get better stack slot usage, even if we don't yet get ideal code gen.  

(The best option would of course be to directly use the register allocator, but a) that's hard, and b) this is an incremental improvement.)

http://reviews.llvm.org/D10402

Files:
  lib/CodeGen/SelectionDAG/StatepointLowering.cpp
  lib/CodeGen/SelectionDAG/StatepointLowering.h
  test/CodeGen/X86/statepoint-stack-usage.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10402.27543.patch
Type: text/x-patch
Size: 14845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150611/99dde682/attachment.bin>


More information about the llvm-commits mailing list