[PATCH] D15302: [Greedy regalloc] Replace analyzeSiblingValues with something new [Part1]

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 09:45:31 PDT 2016


wmi updated this revision to Diff 51175.
wmi added a comment.
Herald added a reviewer: tstellarAMD.

Quentin, I addressed most of your comments.

Major changes or changes needs to pay attention to:

1. Added the patch that hoist Spill inside of BB to earlier place when the src of the spill is killed. It is done in InlineSpiller::hoistSpillInsideBB. With this part of change, some test changes are removed.

2. I am not sure I made the exact change as you expect about where to put postOptimization.

3. I found there was a comment in my previous patch saying DeadRemat is non-null only when regalloc is Greedy. It was wrong. All kinds of register allocator share the same InlineSpiller logic, so DeadRemat and original eliminateDeadRemats (Now it is put into RegAllocBase::postOptimization and RegAllocPBQP::postOptimization) are also necessary for PBQP and Basic.

I also noticed hoistCopies can be improved further. I plan to address it in the following patch.
With HoistSpillHelper, We still need hoistCopies when split-spill-mode=Speed because after removing some redundent spills, the sources of those spills may be shrinked. But when I addressed the review comments, I also found there is case that removing redundent spills not only cannot shrink the source of redundent spills, but also lengthen the live range of dst of those spills. Since we don't depend on hoistCopies to remove redundent spills (HoistSpillHelper can do that work better), we can change hoistCopies to remove spills only when it can shrink the source of redundent spills or at least not lengthen the live range of dst of spills. I can possibly do that by removing hoistCopies and extend hoistSpillInsideBB to handle cases across BBs -- to hoist spill only when its source is killed.


Repository:
  rL LLVM

http://reviews.llvm.org/D15302

Files:
  include/llvm/CodeGen/LiveRangeEdit.h
  lib/CodeGen/InlineSpiller.cpp
  lib/CodeGen/LiveRangeEdit.cpp
  lib/CodeGen/RegAllocBase.cpp
  lib/CodeGen/RegAllocBase.h
  lib/CodeGen/RegAllocBasic.cpp
  lib/CodeGen/RegAllocGreedy.cpp
  lib/CodeGen/RegAllocPBQP.cpp
  lib/CodeGen/Spiller.h
  lib/CodeGen/SplitKit.cpp
  lib/CodeGen/SplitKit.h
  test/CodeGen/AArch64/aarch64-deferred-spilling.ll
  test/CodeGen/AMDGPU/vgpr-spill-emergency-stack-slot.ll
  test/CodeGen/X86/fp128-compare.ll
  test/CodeGen/X86/hoist-spill.ll
  test/CodeGen/X86/new-remat.ll
  test/CodeGen/X86/ragreedy-hoist-spill.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15302.51175.patch
Type: text/x-patch
Size: 123096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160321/81067260/attachment-0001.bin>


More information about the llvm-commits mailing list