[flang-commits] [PATCH] D104586: [flang] Update Reshape runtime library routine and its corresponding unit test

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jun 22 10:44:36 PDT 2021


klausler added inline comments.


================
Comment at: flang/runtime/transformational.cpp:397-401
+    auto *addr = order->OffsetElement<char>(orderSubscript);
+    std::size_t orderElementBytes{order->ElementBytes()};
+    for (SubscriptValue j{0}; j < resultRank; ++j) {
+      auto k{GetInt64(addr, 1, terminator)};
+      addr += orderElementBytes;
----------------
jeanPerier wrote:
> I think `auto k{GetInt64(shape.Element<char>(&orderSubscript), orderElementBytes, terminator)}` might be more idiomatic than manually incrementing the byte offset. @klausler, is this correct ?
Yes.  When something in the runtime can be written as an application of subscripts to an array, that's usually the right way to do it.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104586/new/

https://reviews.llvm.org/D104586



More information about the flang-commits mailing list