[llvm-dev] Want to contribute in LLVM.

Stefanos Baziotis via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 15 13:18:35 PST 2020


Hi Amit,

There are the bugs tagged beginner but last time I checked, IMHO, they were
not that "beginner-friendly" after all.

The way I would recommend that you start with LLVM is by rewriting a pass.
One thing to note here is that this is not really a contribution (i.e.
a commit won't result immediately from that), so if you're only interested
in contributing something with your first try, that won't do it.

But a common theme I see among beginners, including myself when I started,
is that when you're obsessed with landing a commit,
unavoidably you're going to "hack your way towards it". That basically
means that you'll just gather relatively shallow knowledge, maybe
with some breadth, but that limited too, just to commit something. That's
bad and it will probably not serve you in the long run.

This is why for example, in courses which use LLVM as a teaching tool, the
assignments don't ask you to do something
shallow like that but instead they ask for something that requires some
kind of deep knowledge and thought (which you develop along).

To that end, I recommend rewriting a pass (which is btw somewhat common in
courses). Now, that might sound scary but it's not.
The _actual_ goal is not to actually rewrite the pass. Neither all of it,
nor at the production level of LLVM. Rewriting
the pass is just an "artificial goal" only to have something to move
towards. The _actual_ goal is what you'll learn by moving
towards this goal. And what you'll learn will probably be both deep and
broad.

You only need to start simple, like "OK, how do I query this analysis?".
Just that, then you try something like "hmm, how can I inspect / traverse
the results of this analysis" etc. (and the good thing is that for a lot of
these first steps, multiple other passes will have done the exact
same thing and you should feel free to copy code shamelessly as you're
starting out).

After some time doing that, you'll find that you start understanding the
system in some detail and _then_, you'll be equipped to do actual commits.

Now, the question is with which pass to start with? Again, because of the
above, that doesn't really matter, but in any case, it depends on what you
like.
For example, if you're interested in loops, I'd start with LCSSA (and along
with it, I'd give a try to the LLVM Loop Terminology). If you're interested
in inter-procedural optimizations, I'd start with Sparse Conditional
Constant Propagation (SCCP).

If you have no idea where to start or what you like, you might start with
Scalar Replacement of Aggregates (SROA), just because I saw it
in a cool course on UIUC recently and it seems to guide you relatively
well. Here's the link:
http://misailo.web.engr.illinois.edu/courses/526-sp20/,
it's project 1 (again, don't need to even do the whole thing, do the parts
that motivate you; I mean please don't treat that as an _actual_ assignment,
you probably have enough of those already :) ).

So, this got very long, sorry for that, I hope it helps. Please don't
hesitate to reach me for questions.

Best,
Stefanos

Στις Τρί, 15 Δεκ 2020 στις 9:12 μ.μ., ο/η amit kumar via llvm-dev <
llvm-dev at lists.llvm.org> έγραψε:

> Respected Sir/Ma'am,
>                        I'm Amit Kumar, a 3rd-year undergraduate
> student in Computer Science Engineering (CSE) from IIIT Nagpur, India.
> I am new to open source only contributed to HactoberFest in the past 2
> years and I came across LLVM through GSoC and interested in
> building some new features in the newer version's LLVM and contribute
> to the language. I had studied Compiler Design in our courses.
>
> Please help me and show me direction towards starting my journey to
> the open-source contribution.
> Thanks and Regards
> Amit Kumar
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201215/41bde796/attachment.html>


More information about the llvm-dev mailing list