[LAD] Project proposition: llvm based dsp engine

Stéphane Letz letz at grame.fr
Wed Dec 8 12:42:01 UTC 2010

Le 8 déc. 2010 à 12:19, Maurizio De Cecco a écrit :

> On Tuesday12/7/10 2:58 PM, Stéphane Letz wrote:
>> I'm quite dubious of any real optimization you would achieve with this kind of approach, using LLVM.
> >AFAIKS LLVM link time optimization allows some kind of inter module inlining or possibly constant
> > propagation
> Well, optimizations can be added :->.
> Anyway, in my case (jMax, but it valid for other patch based langauges), things like inlining and loop fusion and software pipelining would help a lot for patches with simple objects like add and multiply.

Possibly, but this is somewhat limited to Max like languages...

I would suggest to first test the idea with LLVM: like writing simple modules in C, compile them with LLVM in bitcode, then use LLVM API to combine them using Link Time Optimization stuff.

Without any real benchmark of the approach it does not make real sense IMHO.

>> Again staying in the imperative world makes things much more complicated... go functional!
> I was born as LISP programmer, so, nothing against, just tell me what to do with existing code bases :->

Rewrite them in Faust ((-:

You should come on Faust dev list... You would see how Julius Smith is writing some quite interesting DSP code, by designing basic blocks and libraries, then uses them in very impressive examples. 

Even if Faust is still limited (even if we are hard working on the multi-rate Faust 2 version...), we still think the " write functional DSP code" then use a "semantic based compiler and optimizer" approach to be the most promising in the long term. 

>> PS: BTW LLVM is a really nice tool and very interesting things can be done with it, like using LLVM bitcode format as an interchange format for different architectures and using the JIT for dynamic compilation. We can already do that with Faust LLVM backend where we can generate a bitcode binary, then load it and JIT with a generic "LLVM faust plug-in" loader. This would allow the same bitcode object to be produced by the Faust online compiler for instance and be executed on any target machine.
> Great: now image to use a common framework and standard to make Faust generate bitcode interoperable with LLVM plugins generated with other code, and to have an execution framework for these plugin that can be shared between multiple applications.
> That would solve quite a number of boring engineering problems, like having wrapper for faust (for jMax, for Pd etc etc) objects for a dozen or so of applications.
> OK, may be it is just a dream, but LLVM seems to be an interesting framework to use for this purpose.
> Maurizio

Not sure LLVM is the right basis for that.


More information about the Linux-audio-dev mailing list