Thread overview
GSoC'19: Any LLVM based idea? If not let's think one!
Dec 12, 2018
Reshabh Sharma
Dec 12, 2018
Johan Engelen
Dec 13, 2018
Reshabh Sharma
Dec 13, 2018
Johan Engelen
Dec 13, 2018
Johan Engelen
Dec 15, 2018
Reshabh Sharma
Dec 16, 2018
Nicholas Wilson
Dec 22, 2018
Johan Engelen
Jan 05, 2019
Reshabh Sharma
Jan 05, 2019
Reshabh Sharma
December 12, 2018
Hello,

I'm Reshabh Sharma, a senior year undergrad from India. I completed my last GSoC'18 successfully with LLVM (http://blog.llvm.org/2018/09/integration-of-libc-and-openmp-packages.html).

I was always interested in compilers, but the last GSoC and LLVM dev meeting have given it a different shape!

These days I'm working on a patch on a Global Instruction Scheduler in the optimization phase of LLVM and got another project on Alias Analysis in LLVM from the start of next year in todo list.

LDC uses LLVM as back-end, I would be happy if you have some LLVM/compiler related stuff in wishlist that I can do with D lang this GSoC'19.

Some specific IR passes for D or anything more at the backend side, it will help me to become a better compiler engineer (that I aim to become).

I would be glad to see some core compiler/llvm based ideas floating and would be very happy if someone is ready to mentor me for this GSoC.

Best,
Reshabh Sharma

December 12, 2018
On Wednesday, 12 December 2018 at 17:57:20 UTC, Reshabh Sharma wrote:
>
> I would be glad to see some core compiler/llvm based ideas floating and would be very happy if someone is ready to mentor me for this GSoC.

I'm not sure whether I have the time to mentor, but some ideas that involve LDC and LLVM :

- exploiting immutability of variables (notably of structs such as string slices)
- devirtualization
- improve debuginfo
- ASan with GC and multithreading
- function multiversioning

Browsing our issue tracker on Github helps. There are a number of ideas posted there.

With which organisation would you submit your idea? (For LDC, you should contact Dlang foundation)

-Johan

December 13, 2018
On Wednesday, 12 December 2018 at 22:50:16 UTC, Johan Engelen wrote:
> On Wednesday, 12 December 2018 at 17:57:20 UTC, Reshabh Sharma wrote:

> - exploiting immutability of variables (notably of structs such as string slices)
> - devirtualization
> - improve debuginfo
> - ASan with GC and multithreading
> - function multiversioning
>
> Browsing our issue tracker on Github helps. There are a number of ideas posted there.

I might be interested in working in Devirtualization https://github.com/ldc-developers/ldc/issues/1828

> With which organisation would you submit your idea? (For LDC, you should contact Dlang foundation)

I am planning to work with Dlang this GSoC, I told my interests to @Michael Parker and he directed me to ask in LDC forum.

Thanks,
Reshabh Sharma

December 13, 2018
On Thursday, 13 December 2018 at 06:10:55 UTC, Reshabh Sharma wrote:
>
> I might be interested in working in Devirtualization https://github.com/ldc-developers/ldc/issues/1828

See also: https://github.com/ldc-developers/ldc/pull/2397

December 13, 2018
On Wednesday, 12 December 2018 at 22:50:16 UTC, Johan Engelen wrote:
>
> - exploiting immutability of variables (notably of structs such as string slices)
> - devirtualization

Btw, I think these are somewhat similar and that the first may lead to larger performance gains. Once the first works, the second follows almost automatically (after a deeper study of D language semantics of object runtime type).

-Johan
December 15, 2018
>See also: https://github.com/ldc-developers/ldc/pull/2397
>
On Thursday, 13 December 2018 at 19:17:15 UTC, Johan Engelen wrote:
> On Wednesday, 12 December 2018 at 22:50:16 UTC, Johan Engelen wrote:
>>
>> - exploiting immutability of variables (notably of structs such as string slices)
>> - devirtualization
>
> Btw, I think these are somewhat similar and that the first may lead to larger performance gains. Once the first works, the second follows almost automatically (after a deeper study of D language semantics of object runtime type).
>

Thanks, I don't have much knowledge about this so I'll go with your words :) then I would insist that we can have "exploiting immutability of variables" as a project idea.

Can you please suggest some resources for getting a bit more idea about how others have exploited immutability of variables or is there a generic term for this (I could not find much online :/ ).

I can help in drafting a project idea for this and if it could get a mentor then I'm willing to be the part (If I qualify to be) else it will definitely catch some eyes!

Best,
Reshabh Sharma
December 16, 2018
On Saturday, 15 December 2018 at 19:52:42 UTC, Reshabh Sharma wrote:
>>See also: https://github.com/ldc-developers/ldc/pull/2397
>>
> On Thursday, 13 December 2018 at 19:17:15 UTC, Johan Engelen wrote:
>> On Wednesday, 12 December 2018 at 22:50:16 UTC, Johan Engelen wrote:
>>>
>>> - exploiting immutability of variables (notably of structs such as string slices)
>>> - devirtualization
>>
>> Btw, I think these are somewhat similar and that the first may lead to larger performance gains. Once the first works, the second follows almost automatically (after a deeper study of D language semantics of object runtime type).
>>
>
> Thanks, I don't have much knowledge about this so I'll go with your words :) then I would insist that we can have "exploiting immutability of variables" as a project idea.
>
> Can you please suggest some resources for getting a bit more idea about how others have exploited immutability of variables or is there a generic term for this (I could not find much online :/ ).

(In case you haven't seen it (C++ devirtualisation) https://www.youtube.com/watch?v=Dt4UehzzcsE&index=36&list=PL_R5A0lGi1AARZysSx4VzpaLAzny4es2e&t=0s )

Unlike C++ where const isn't any good for optimisation, in D an immutable variable will never change and immutable is transitive: no mutable references to it are allowed, only const (which is a guarantee to not change the data through this reference) and immutable, neither of which may be used to change the value _or anything reachable from it_.
As a consequence of this not only can you safely cache the value and any values derived from it, the data referenced by an immutable pointer will never alias mutable data (it may alias const data but if it does then that data is immutable so it will never change).

The devirtulisation then follows from the fact that the vtable is immutable and assigned once in construction (unlike C++).

> I can help in drafting a project idea for this and if it could get a mentor then I'm willing to be the part (If I qualify to be) else it will definitely catch some eyes!

If you're having trouble finding a mentor, I could do it.
December 22, 2018
On Sunday, 16 December 2018 at 05:59:37 UTC, Nicholas Wilson wrote:
> On Saturday, 15 December 2018 at 19:52:42 UTC, Reshabh Sharma wrote:
>>
>> I can help in drafting a project idea for this and if it could get a mentor then I'm willing to be the part (If I qualify to be) else it will definitely catch some eyes!
>
> If you're having trouble finding a mentor, I could do it.

I probably won't be able to full-time mentor this. But I do want to be involved as I've already been working on it.

(Don't forget that working on AddressSanitizer for our GC and fibers would also be pretty cool)

-Johan

January 05, 2019
On Sunday, 16 December 2018 at 05:59:37 UTC, Nicholas Wilson wrote:

> If you're having trouble finding a mentor, I could do it.

Sorry for the late reply! I got super engaged in project submissions and the much awaited holidays ^_^

Thanks @nicholas for showing interest in mentoring, are you still interested? I will be happy to work on this :)

Best,

Reshabh Sharma
January 05, 2019
On Saturday, 22 December 2018 at 17:10:12 UTC, Johan Engelen wrote:

> I probably won't be able to full-time mentor this. But I do want to be involved as I've already been working on it.

No worries, I would be happy to keep you updated with the progress!


> (Don't forget that working on AddressSanitizer for our GC and fibers would also be pretty cool)

I'm up to any cool compiler related stuff these days ;) Let's then more formally define a skeleton for the project, as it would be easier for me to go through the literature supporting the project.


Best,

Reshabh Sharma