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