[PATCH] D27596: Add a PreRASplit pass to enable more shrinkwrap

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 03:59:57 PST 2016


wmi created this revision.
wmi added reviewers: qcolombet, MatzeB.
wmi added subscribers: llvm-commits, davidxl.
wmi set the repository for this revision to rL LLVM.
Herald added a subscriber: mgorny.

The patch is to solve the problem mentioned in PR29154.

This pass tries to split the live ranges of params which are passed via hard registers and live across calls inside the function. The live range of such param could be split into two parts: The first part contains the copy from param passing register and will never live across call, so it gets the freedom to be allocated to any non-CSR (Callee-Saved-Register). The second part will live across calls and will only be allocated to CSR.

The benefit of doing the split is we may get a better chance to do shrinkwrap. Another benefit is param passing copy may be sinked from entry to a colder branch (The fact that copy from hardreg cannot be sinked by machine sinking pass makes this patch more meaningful).

We get 2% performance improvement for an internal protobuf benchmark (https://github.com/google/protobuf) on SandyBridge. I am getting more performance number using spec2000.


Repository:
  rL LLVM

https://reviews.llvm.org/D27596

Files:
  include/llvm/CodeGen/Passes.h
  include/llvm/InitializePasses.h
  lib/CodeGen/CMakeLists.txt
  lib/CodeGen/CodeGen.cpp
  lib/CodeGen/PreRASplit.cpp
  lib/CodeGen/RegAllocBasic.cpp
  lib/CodeGen/TargetPassConfig.cpp
  test/CodeGen/Thumb2/cbnz.ll
  test/CodeGen/X86/fold-call-oper.ll
  test/CodeGen/X86/half.ll
  test/CodeGen/X86/pr20020.ll
  test/CodeGen/X86/pre-ra-split1.ll
  test/CodeGen/X86/pre-ra-split2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27596.80835.patch
Type: text/x-patch
Size: 26057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161209/f5557f42/attachment-0001.bin>


More information about the llvm-commits mailing list