[flang-dev] [llvm-dev] Multidimensional array indexing intrinsics

Alexandre Isoard via flang-dev flang-dev at lists.llvm.org
Mon Aug 26 14:19:43 PDT 2019


Hi Prashanth,

Do you know how that would map to the mdspan proposal of C++? (
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0009r9.html)
Should we split the stride from the bound, to represent sub-rectangles, or
padding? (this would require 2 "size" per dimension, but it is quite common
in video/image processing)
Should we require the stride to be multiple of one an other and in the
decreasing order? (this could allow to encode transpose without having to
move data around)

As for us, we went for an "underlying geometry" attribute/metadata, which
takes a bunch of sizes.
It gives for each argument a hint on how to de-linearize the accesses (aka.
the dimension's sizes), and the address computation still uses gep.
But we still need a few assert that bound the indexes to not overflow their
respective dimension's upper bound, to avoid the gep delinearization to
involve modulo.

It's far from ideal, but it allows us to support legacy codes that were
written in linearized form.
Our main issue is actually handling memcpy-like code, which have both a
linearized address computation but also a linearized loop nest structure...

-- 
*Alexandre Isoard*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/flang-dev/attachments/20190826/fa361d38/attachment.html>


More information about the flang-dev mailing list