[PATCH] D49353: [RegAlloc] Skip global splitting if the live range is huge and its spill is trivially rematerializable

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 15 13:51:14 PDT 2018


wmi created this revision.
wmi added reviewers: qcolombet, MatzeB.

We run into a case where machineLICM hoists a large number of live ranges outside of a big loop because it thinks those live ranges are trivially rematerializable. In regalloc, global splitting is tried out first for those live ranges before they are spilled and rematerialized. Because the global splitting algorithm is quadratic, increasing a lot of global splitting candidates causes huge compile time increase (50s to 1400s on my local machine).

However, we think for live ranges which are very large and are trivially rematerialiable, it is better to just skip global splitting so as to save compile time with little chance of sacrificing performance.  We uses the segment size of live range to indirectly evaluate whether the global splitting of the live range can introduce high cost, and use an option as a knob to adjust the size limit threshold.

performance evaluation is ongoing.


Repository:
  rL LLVM

https://reviews.llvm.org/D49353

Files:
  lib/CodeGen/RegAllocGreedy.cpp
  test/CodeGen/X86/limit-split-cost.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49353.155596.patch
Type: text/x-patch
Size: 8905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180715/3e5727f4/attachment.bin>


More information about the llvm-commits mailing list