[all-commits] [llvm/llvm-project] 361bc8: [flang][hlfir] Propagate non-default lbounds from ...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu Jun 8 08:58:47 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 361bc8532959c53626c397a2aecce2bd6d53ce1c
      https://github.com/llvm/llvm-project/commit/361bc8532959c53626c397a2aecce2bd6d53ce1c
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-06-08 (Thu, 08 Jun 2023)

  Changed paths:
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    A flang/test/Lower/HLFIR/select-type-selector.f90

  Log Message:
  -----------
  [flang][hlfir] Propagate non-default lbounds from the mutable box.

The issue affected type select tests, such that inside the type guard
block the associated variable was using default lbounds instead of
inheriting it from the original variable.

The bridge's `genExprBox` ended up creating BoxValue from a MutableBoxValue
without setting non-default lbounds. So the hlfir.declare generated
for the associated name inside the type guard block was also using
the default lbounds. The fix is to read the value of the mutable box
and propagate the lbounds to the new BoxValue.

The fix might affect more than just select type cases.

Reviewed By: tblah

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




More information about the All-commits mailing list