This is an archive of the discontinued LLVM Phabricator instance.

Tune the Greedy RA to prefer split by region in some cases.
Needs ReviewPublic

Authored by linzj on Aug 26 2020, 10:51 PM.

Details

Summary

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.
  1. 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.

Diff Detail

Event Timeline

linzj created this revision.Aug 26 2020, 10:51 PM
linzj requested review of this revision.Aug 26 2020, 10:51 PM
lkail added a subscriber: lkail.Aug 27 2020, 3:06 AM