[llvm-dev] Python build dependency in LLVM and/or clang?

Mehdi AMINI via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 10 08:20:25 PDT 2019


On Fri, Jul 5, 2019 at 3:43 AM Simon Tatham via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello llvm-devs,
>
> I'm currently starting to look at implementing compiler intrinsics for the
> Arm MVE vector instruction set.
>
> In a similar sort of style to the existing NEON intrinsics, this is going
> to involve describing the set of functions needed in Tablegen, and then
> processing that data into a header file and some bits and pieces to compile
> into clang (the list of builtins, data tables needed by Sema or CodeGen,
> etc). But the differences between MVE and NEON are large enough -
> particularly the predication system - that I'm going to need new Tablegen
> backends, rather than reusing the NEON ones.
>
> I would like, if possible, to write these Tablegen backends in Python, by
> consuming the output of the 'llvm-tblgen -dump-json' feature I added to
> Tablegen last year. I think they'll be simpler and more concise that way
> than in C++, not to mention quicker to develop.
>
> But before I do that, I wanted to check whether there would be any
> objection on grounds of build dependencies. Is it acceptable to require
> Python as part of the normal build process for LLVM? Or is Python something
> that can be used in places like the test suite and developer utilities, but
> has to be kept out of the main build to make bootstrapping as easy as
> possible? I looked for a written policy on this, but didn't find one.


More than the bootstrapping question or adding a dependency to the build,
I'm wary of using Python pervasively with respect to maintenance and
readability of the code. While convenient for small scripts, the lack of
static types is making it hard to understand and track the code beyond this
simple use-case. We don't have a style guide for python, the tools
(formatting, indexing, IDEs, ...) used for C++ development in LLVM aren't
providing the same experience with Python, etc.

-- 
Mehdi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190710/e6e2e28b/attachment.html>


More information about the llvm-dev mailing list