[llvm-dev] [RFC] A new multidimensional array indexing intrinsic

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 29 13:30:34 PDT 2019


Am So., 28. Juli 2019 um 17:34 Uhr schrieb Chris Lattner <clattner at nondot.org>:
>
> On Jul 25, 2019, at 7:20 AM, Michael Kruse via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Am Mi., 24. Juli 2019 um 16:13 Uhr schrieb Tim Northover
> <t.p.northover at gmail.com>:
>
>> Siddharth’s original RFC
> ...
>
> Apart from all that, I'm pretty disappointed to see this as an
> intrinsic though. GEP is such a fundamental part of addressing in LLVM
> that bifurcating it into an intrinsic for either a language or an
> analysis seems like we'd be papering over a language deficiency.
>
>
> What is your preferred approach?
>
>
> +mlir mailing list, even though I generally hate cross posting.
>
> Have you been following what is happening on the MLIR side of the world?  It directly supports multi-dimensional arrays with both value and buffer semantics (e.g. load, store, and DMA operations).  It is specifically focused on solving these sorts of problems, and is the current proposed direction for the flang compiler IR (as well as a bunch of HPC applications that haven’t gone public yet).  Even if it isn’t directly relevant to this work, it is worth checking out to see if some of the ideas can be borrowed.

I have been following MLIR and even pointed the flang team towards it
since this kind of access is more important in Fortran than in C/C++.

IMHO the issue is representation since LLVM-IR does not have the
primitives that MLIR has, specifically there is no Memref type that --
in contrast to LLVM-IR pointer types are multi-dimensional, and -- in
contrast to LLVM-IR array types can have dependent and dynamic shape.

Adding a MemRef type this would go quite deep into LLVM-IR
fundamentals. Do you think it would be worth it?

Michael


More information about the llvm-dev mailing list