[PATCH 0/5] LiveInterval refactoring

Matthias Braun mbraun at apple.com
Tue Sep 3 14:41:02 PDT 2013


On Sep 3, 2013, at 12:17 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:

> 
> On Sep 3, 2013, at 11:58 AM, Matthias Braun <mbraun at apple.com> wrote:
> 
>> 
>> On Sep 3, 2013, at 11:52 AM, Benjamin Kramer <benny.kra at gmail.com> wrote:
>> 
>>> 
>>> On 03.09.2013, at 20:46, Matthias Braun <mbraun at apple.com> wrote:
>>> 
>>>> Currently I see these options:
>>>> 
>>>> 1:
>>>> live with a freestanding struct LiveInterval;
>>>> 
>>>> 2:
>>>> class LiveIntervalBase {
>>>> public: struct Segment {};
>>>> };
>>>> template <> struct isPodLike<LiveIntervalBase::Segment> /* … */
>>>> class LiveInterval : public LiveIntervalBase {
>>>> public:
>>>>   SmallVector<Segment> /* … */
>>>> };
>>>> 
>>>> 3:
>>>> /** please do not use directly but LiveInterval::Segment */
>>>> struct LiveSegment { /* … */ }
>>>> template <> struct isPodLike<LiveSegment> /* … */
>>>> class LiveInterval {
>>>> public:
>>>>  typedef LiveSegment Segment;
>>>>  SmallVector<Segment> /* … */
>>>> };
>>>> 
>>>> 4: Drop the isPodLike, no idea if/how badly it affects performance
>>> 
>>> When compiling with Clang we use the is_trivially_copyable type trait as a base line for isPodLike. That should be sufficient for the Segment class. Not sure if we care enough about performance on other compilers.
>> Indeed, sounds like a good enough reason to drop isPodLike here, IMHO.
> 
> +1 Go for it.
> 
> Clang’s release build ought to be self hosting anyway, so there is no reason to worry about performance on other compilers.
> 
> Thanks,
> /jakob

Attached is a patch for the LiveRange -> LiveInterval::Segment renaming. I’m starting the rebasing of my other patches now.

If we are renaming anyway, I would propose to rename LiveInterval to RegLiveRange (or RegisterLiveRange), which is more logical as it will become a subclass of LiveRange with just a register number and spill weight added.

Greetings,
	Matthias


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130903/43a836d6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rename_liverange.patch
Type: application/octet-stream
Size: 77199 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130903/43a836d6/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130903/43a836d6/attachment-0001.html>


More information about the llvm-commits mailing list