[all-commits] [llvm/llvm-project] 9a659f: [flang] fix MAXVAL(x%array_comp_with_custom_lower_...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Mar 4 08:52:26 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a659fac2f40754dcef273f0ee4bb3352e4a6ee9
      https://github.com/llvm/llvm-project/commit/9a659fac2f40754dcef273f0ee4bb3352e4a6ee9
  Author: jeanPerier <jperier at nvidia.com>
  Date:   2025-03-04 (Tue, 04 Mar 2025)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
    M flang/test/HLFIR/maxval-elemental.fir

  Log Message:
  -----------
  [flang] fix MAXVAL(x%array_comp_with_custom_lower_bounds) (#129684)

The HLFIR inlining of MAXVAL kicks in at O1 and more when the argument
is an array component reference but the implementation did not account
for the rare cases where the array components have non default lower
bounds.

This patch fixes the issue by using `getElementAt` to compute the
element address.
Rename `indices` to `oneBasedIndices` for more clarity.



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