[PATCH 1/5] refactor LiveInterval: introduce new LiveRanges class
Andrew Trick
atrick at apple.com
Fri Sep 6 20:58:13 PDT 2013
On Sep 6, 2013, at 4:50 PM, Matthias Braun <mbraun at apple.com> wrote:
> The name LiveRanges has been changed in the second iteration of the patches it’s indeed called LiveRange in singular form now (which is indeed a better name). This is the structure after applying this patchset:
>
> * A LiveRange object contains a list of LiveRange::Segment objects which represent intervals
> * LiveIntervall is simply a subclass of LiveRange adding a field for the register number and spill weight
> * Several algorithms that operated on LiveInterval but weren’t really bound to a specific register/machine instructions now work on the LiveRange base class.
> * Not in this patch series, but I’m working on this: Introduce a new LiveIntervall::SubRange class which is a subclass of LiveRange with a LaneMask added, managing liveness of a “subregister”/a group of lanes.
I like what Matthias did in the second iteration of patches, and noticed Jakob gave the same feedback (I read patch #1 first).
LiveRange is now close to the traditional concept of an allocatable register unit. But instead of a disjoint set of Intervals we call them Segments. (I can't complain about that terminology being the one who started it.)
LiveInterval is a magical LLVM-specific thing that extends the LiveRange into a new dimension of fun overlapping subranges. The name doesn't make any mathematical sense, but it makes a lot of sense given that we don't want to rename all our passes!
-Andy
> On Sep 6, 2013, at 4:16 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>
>>
>> On Sep 6, 2013, at 3:36 PM, Andrew Trick <atrick at apple.com> wrote:
>>
>>>
>>> On Aug 29, 2013, at 6:07 PM, Matthias Braun <matze at braunis.de> wrote:
>>>
>>>>
>>>> LiveRanges has logic to manage a set list LiveRange instances
>>>> and a list of value numbers which previously was in LiveInterval,
>>>> without having details like spill weight or a fixed register number.
>>>> LiveInterval is now a direct subclass of LiveRanges and simply adds the
>>>> spill weight and the register number.
>>>> ---
>>>> include/llvm/CodeGen/LiveInterval.h | 143 +++++++++++++++++++++--------------
>>>> lib/CodeGen/LiveInterval.cpp | 128 +++++++++++++++----------------
>>>> lib/CodeGen/LiveIntervalAnalysis.cpp | 20 ++---
>>>> 3 files changed, 156 insertions(+), 135 deletions(-)
>>>>
>>>> <0001-refactor-LiveInterval-introduce-new-LiveRanges-class.patch>_______________________________________________
>>>
>>> I don’t want to hold up patches with philosophical arguments—and it’s not your fault that some terminology is already misused.
>>
>> I think we should use this opportunity to get the names right. We’re causing massive churn anyway.
>>
>>> This is just something to think about:
>>>
>>> In compiler literature a LiveRange is an allocatable entity as seen by the register allocator.
>>>
>>> By definition, a range is a disjoint set of intervals where each interval represents all values between two end points. So in the context of a compiler, interfence is computed by checking intersection of intervals.
>>
>> It seems that one of these definitions will have to give since we want to represent the liveness of a virtual register as a linked list of {mask + disjoint set of intervals}.
>>
>> /jakob
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130906/731aa2c8/attachment.html>
More information about the llvm-commits
mailing list