[all-commits] [llvm/llvm-project] 294be6: [CalcSpillWeights] Propagate the fact that a live-...

qcolombet via All-commits all-commits at lists.llvm.org
Wed Jul 15 17:58:03 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 294be6b5d32e1fe44d0b36cd46b2931c5f0634c4
      https://github.com/llvm/llvm-project/commit/294be6b5d32e1fe44d0b36cd46b2931c5f0634c4
  Author: Quentin Colombet <qcolombet at apple.com>
  Date:   2020-07-15 (Wed, 15 Jul 2020)

  Changed paths:
    M llvm/lib/CodeGen/CalcSpillWeights.cpp

  Log Message:
  -----------
  [CalcSpillWeights] Propagate the fact that a live-interval is not spillable

When we calculate the weight of a live-interval, add some code to
check if the original live-interval was markied as not spillable and
if so, progagate that information down to the new interval.

Previously we would just recompute a weight for the new interval,
thus, we could in theory just spill live-intervals marked as not
spillable by just splitting them. That goes against the spirit of
a non-spillable live-interval.

E.g., previously we could do:
v1 =  // v1 must not be spilled
...
= v1

Split:
v1 = // v1 must not be spilled
...
v2 = v1 // v2 can be spilled
...
v3 = v2 // v3 can be spilled
= v3

There's no test case for that one as we would need to split a
non-spillable live-interval without using LiveRangeEdit to see this
happening.
RegAlloc inserts non-spillable intervals only as part of the spilling
mechanism, thus at this point the intervals are not splittable anymore.
On top of that, RegAlloc uses the LiveRangeEdit API, which already
properly propagate that information.

In other words, this could only happen if a target was to mark
a live-interval as not spillable before register allocation and
split it without using LRE, e.g., through
LiveIntervals::splitSeparateComponent.




More information about the All-commits mailing list