[PATCH] D86680: Tune the Greedy RA to prefer split by region in some cases.

zuojian lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 22:51:33 PDT 2020


linzj created this revision.
linzj added reviewers: stoklund, rtrieu, myatsina, Nicola.
Herald added subscribers: llvm-commits, hiraditya, qcolombet, MatzeB.
Herald added a project: LLVM.
linzj requested review of this revision.

Originally the RA calculates the cost from constraint cost and global cost,
then compares the cost with the current best cost.
It has the following problems:

1. The spill cost is calculated repeated. As showed in the test cases

duplicate-spill-weight.ll, the value base's spill cost is repeatedly
added at

  a. the inline asm constraint at the beginning of a block.
  b. the inline asm constraint at the end of a block.
  c. The de-active EB when a block prefers reg-out.

2. The input best cost at calculateRegionSplitCost is directly compared

with the cost calculated. The costs calculated should be compared with
each other, then compare with the input best cost. The input best cost
and the region costs are defined in standards with subtle differences.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86680

Files:
  llvm/lib/CodeGen/RegAllocGreedy.cpp
  llvm/test/CodeGen/AArch64/duplicate-spill-weight.ll
  llvm/test/CodeGen/ARM/ssub_sat.ll
  llvm/test/CodeGen/X86/avx512-masked_memop-16-8.ll
  llvm/test/CodeGen/X86/shift-i128.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86680.288195.patch
Type: text/x-patch
Size: 133055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200827/4c6de9c9/attachment-0001.bin>


More information about the llvm-commits mailing list