[LLVMdev] GSoC 2011: Superoptimization for LLVM IR
variadic.template at googlemail.com
Thu Apr 7 05:47:13 PDT 2011
I am no llvm/compiler/optimization-expert and not able to mentor this
I just want to say that this sounds very interesting and I'm hoping that
else could mentor it, or, at least, leave some useful comments, as it sounds
something that could improve llvm a lot - doesn't it?
2011/4/6 Rafael Auler <rafaelauler at gmail.com>
> I want to present my project for GSoC 2011 for LLVM below. It would be very
> nice to hear suggestions and your opinion, thanks!
> Superoptimization for LLVM IR
> This project focuses on implementing superoptimization algorithms targeted
> the LLVM IR. The project uses arbitrary LLVM bitcode as a training set to
> discover new peephole optimizations that can be later integrated into LLVM
> instruction simplify phase or as a separate peephole optimization pass.
> Code optimization is the task of using a faster sequence of instructions
> compute the same information, compared to a previous code sequence. The old
> sequence may then be substituted by the new one, creating a faster program
> with the same behavior. The problem of ﬁnding a code sequence that does
> computation in optimal time is undecidable and, in practice, optimizations
> discovered by humans using analytical reasoning. Finding new optimizations
> an automated fashion, using a search algorithm, is a diﬀerent approach to
> problem and became known in literature as superoptimization, term coined by
> Massalin .
> Using computer-aided optimization discovery, diﬀerent kind of optimizations
> unnoticed by humans may be detected, specially those speciﬁc to the target
> machine code . This project will focus on implementing a superoptimizer
> which will exhaustively investigate new optimizations for the LLVM IR.
> this approach, I hope to greatly contribute to the current LLVM instruction
> simplify phase, introducing new substitutions identiﬁed in this project.
> There is already a superoptimizer for LLVM in initial stages of
> The existing superoptimizer currently limits its search space to a few
> mations. This project will focus on improving this current superoptimizer
> extending the number of transformations applied and thus greatly increasing
> the search space.
> In order to test the superoptimizer eﬃciency, it will use LLVM bitcodes
> compiled from the entire LLVM test suite and SPEC to harvest possible code
> sequence optimizations. When successfully identiﬁed, these optimizations
> be implemented directly as peephole optimizations for LLVM IR.
> This project is expected to last three months, as follows.
> • 1st month, 1st week - Study the LLVM IR in order to establish a
> list of axioms, that is, valid transformations that determine the search
> algorithm capability. There is an important trade-oﬀ to investigate here,
> since using fewer transformations will lead to faster searches, but several
> good optimizations may be missed.
> • 1st month, 2nd week - Thorough study of the current implemented
> base and new algorithm design to support arbitrary transformations.
> • 1st month, 3rd week until end of project - Implementation of the
> search algorithm.
> • 2nd month - Test phase begins. Test algorithm with simple transforma-
> tions searching for optimized code sequences.
> • 3rd month - Harvesting new optimizations and implementing ﬁxes to
> the search algorithm as more performance feedback from training data is
> I am a Master student at the University of Campinas (UNICAMP), Brazil
> zone GMT -3). In my master thesis, I have already worked with
> tion theory and automatic code sequence searching. But instead of using it
> optimization purposes, I use this to automatically generate a LLVM backend
> based on a machine description using the ArchC architecture description
> guage. The backend patterns are ﬁxed and the implementation of the pattern
> is inferred using a search algorithm similar to the one used on
> Thus, I have experience both on superoptimizer theory and LLVM code.
>  Sorav Bansal and Alex Aiken. Automatic generation of peephole
> mizers. SIGPLAN Not., 41:394–403, October 2006.
>  Henry Massalin. Superoptimizer: a look at the smallest program. In
> ASPLOS-II: Proceedings of the second international conference on Architec-
> tual support for programming languages and operating systems, pages 122–
> 126, Los Alamitos, CA, USA, 1987. IEEE Computer Society Press.
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev