[all-commits] [llvm/llvm-project] fba06f: [flang][hlfir] Moved TODO for polymorphic vector s...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Wed Jul 12 13:53:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fba06f7a7c54885f5336acd39b88c166e075af61
      https://github.com/llvm/llvm-project/commit/fba06f7a7c54885f5336acd39b88c166e075af61
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-07-12 (Wed, 12 Jul 2023)

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

  Log Message:
  -----------
  [flang][hlfir] Moved TODO for polymorphic vector subscripted expressions.

If I understand it correctly, the TODO is intended to catch cases
when we may need to create a temporary array for polymorphic entities
resulting from a vector subscription, i.e. when the final expression
type of hlfir.elemental_addr is polymorphic. The TODO check was done
very early, so it kicked in for cases where the it should not have.
For example,
```
type t
  integer n
end type
class(t), pointer :: p(:)
... p(vector_of_indices)%n
```

Such designators are supported by FIR lowering and can be currently
supported by HLFIR, but the TODO prevented this. I just moved the TODO
check later in the lowering pipeline.

I also updated the comment trying to describe my understanding of how
the correct mold entity can be computed for the elemental operation
producing HLFIR expression of polymorphic type.

This change provides 34 new passes in my nag testing.

Reviewed By: tblah

Differential Revision: https://reviews.llvm.org/D154814




More information about the All-commits mailing list