[all-commits] [llvm/llvm-project] 02f61a: [flang] Use box for components with non-default lo...

Asher Mancinelli via All-commits all-commits at lists.llvm.org
Thu May 8 13:08:29 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 02f61ab46b1608c26fd72862d4b46cbb7b034889
      https://github.com/llvm/llvm-project/commit/02f61ab46b1608c26fd72862d4b46cbb7b034889
  Author: Asher Mancinelli <ashermancinelli at gmail.com>
  Date:   2025-05-08 (Thu, 08 May 2025)

  Changed paths:
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/test/Lower/HLFIR/designators-component-ref.f90

  Log Message:
  -----------
  [flang] Use box for components with non-default lower bounds (#138994)

When designating an array component that has non-default lower bounds
the bridge was producing hlfir designates yielding reference types,
which did not preserve the bounds information. Then, when creating
components, unadjusted indices were used when initializing the
structure.

We could look at the declaration to get the shape parameter, but this
would not be preserved if the component were passed as a block argument.
These results must be boxed, but we also must not lose the contiguity
information either. To address contiguity, annotate these boxes with the
`contiguous` attribute during designation.

Note that other designated entities are handled inside the
HlfirDesignatorBuilder while component designators are built in
HlfirBuilder. I am not sure if this handling should be moved into the
designator builder or left in the general builder, so feedback is
welcome.

Also, I wouldn't mind finding a test that demonstrates a box-designated
component with the contiguous attribute really is determined to be
contiguous by any passes down the line checking for that. I don't have a
test like that yet.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list