[PATCH] D11686: [RegAlloc] Trace sibling copies when checking for rematerializability during spill weight calculation (PR24139)

Robert Lougher rob.lougher at gmail.com
Fri Jul 31 11:49:21 PDT 2015


rob.lougher created this revision.
rob.lougher added a reviewer: qcolombet.
rob.lougher added a subscriber: llvm-commits.
Herald added subscribers: qcolombet, MatzeB.

PR24139 ( https://llvm.org/bugs/show_bug.cgi?id=24139 ) contains an analysis of poor register allocation.  One of the findings was that when calculating the spill weight, a rematerializable interval once split is no longer rematerializable.  This is because the isRematerializable check in CalcSpillWeights.cpp does not follow the copies introduced by live range splitting (after splitting, the live interval register definition is a copy which is not rematerializable).

My initial fix used a hack which was sufficient for my experiments.  This patch is a cleaned up version using a different approach.  It, however, obtains the same results as my initial hack. 

I have not included a test as I don't know how to test it!  I could write a test that counted the number of spills but I feel that any such test would be too fragile in the long run.  Advice welcome...

http://reviews.llvm.org/D11686

Files:
  include/llvm/CodeGen/CalcSpillWeights.h
  lib/CodeGen/CalcSpillWeights.cpp
  lib/CodeGen/LiveRangeEdit.cpp
  lib/CodeGen/RegAllocBasic.cpp
  lib/CodeGen/RegAllocGreedy.cpp
  lib/CodeGen/RegAllocPBQP.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11686.31136.patch
Type: text/x-patch
Size: 7537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150731/a9736171/attachment.bin>


More information about the llvm-commits mailing list