[llvm-dev] RFC: Adding IR Transformation examples/tutorial code to llvm-project
David Blaikie via llvm-dev
llvm-dev at lists.llvm.org
Thu Oct 24 18:24:54 PDT 2019
Sounds good - bonus points if these examples were motivated with a
continuation to the Kaleidoscope tutorial - Eric Christopher and I did a
tutorial on debug info back in 2014 and included new chapters for
Kaleidoscope for future usage.
On Thu, Oct 24, 2019 at 4:47 PM Florian Hahn via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Hi,
>
> I’d like to propose adding a new example directory
> (llvm/examples/IRTransforms) as a new home for example code used by various
> tutorials. After talking to a few people at the Developers meeting, it
> became clear to me that it would be valuable to have the code examples for
> various tutorials in-tree to keep them from bit-rotting and make it very
> easy to build them.
>
> I’d suggest adding new IR pass examples to llvm/examples/IRTransforms. The
> passes in that directory will be built as an ExamplesIRTransforms library,
> which exposes initializeExampleIRTransforms to initialise the passes.
> Additionally, if LLVM_BUILD_EXAMPLES=On, we add a -DBUILD_EXAMPLES define,
> which is then used in opt to make the example passes available if
> LLVM_BUILD_EXAMPLES=On. I think that allows for relatively friction-less
> integration of the example passes into `opt`.
>
> I’ve put up a patch doing exactly that: https://reviews.llvm.org/D69416
> and added a few reviewers, but please join in if you have any thoughts!
>
> Please let me know if you have any concerns or suggestions to improve the
> CMake setup & co.
>
>
> As initial example, it contains the code we used for the IR
> transformations in the 'Getting Started With LLVM: Basics’ tutorial.
>
> I think there were other tutorials with examples that would be great to
> have there, like 'Writing Loop Optimizations in LLVM’.
>
> As a second step, to make those examples even more valuable, it would be
> great to provide an accompanying text version of the tutorials. But I would
> suggest we start with adding the code, which we already have.
>
> Cheers,
> Florian
> _______________________________________________
> 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/20191024/5634b515/attachment.html>
More information about the llvm-dev
mailing list