[cfe-dev] SSA form in Clang

mats petersson mats at planetcatfish.com
Wed May 6 04:58:05 PDT 2015


On 4 May 2015 at 09:47, James Courtier-Dutton <james.dutton at gmail.com>
wrote:

> On 1 May 2015 at 10:58, Hayden Livingston <halivingston at gmail.com> wrote:
> > For my project (a subset of C) I'm trying to do optimizations at the
> > source level language and wondering why Clang doesn't have an SSA form
> > representation.
> >
> > Is it not useful, since LLVM does almost all the optimizations?
>
> I am wondering why you would want to do that?
> Source code should be optimized for readability and maintainability by
> humans, and not necessarily optimized for performance.
> LLVM does performance optimizations that would make the resulting C
> source code much less readable.
>

I would add to this that "not all programs are written in C" (or something
resembling C). LLVM is used as a backend for a few other languages too, and
having one set of optimisations that work for "everything" is much better
than looking at the early phase of translation, where the language is still
resembling the source, and you'd have to do things special for each
language (or language construct).

See
http://en.wikipedia.org/wiki/LLVM#Front_ends:_programming_language_support
for a list of languages that use LLVM as the code generation.

Working on common functionality helps everyone, regardless of what language
it is.

--
Mats

>
> Something called "re-factoring" is normally a useful thing to do at
> the source code level, resulting in source code that is easier to
> maintain.
> Another area might be analyzing the source code and recognising areas
> that can be multi-threaded, thus improving performance that way.
> Analyzing the source code and identifying areas likely to cause deadlocks.
> Essentially, useful things to check for that a compiler does not do.
>



>
> Kind Regards
>
> James
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150506/ef4d09bb/attachment.html>


More information about the cfe-dev mailing list