[all-commits] [llvm/llvm-project] 5d4824: [flang] Inline minval/maxval over elemental/design...

khaki3 via All-commits all-commits at lists.llvm.org
Thu Aug 15 17:33:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d48248755f41245be031791ff6ea7a79a5a8912
      https://github.com/llvm/llvm-project/commit/5d48248755f41245be031791ff6ea7a79a5a8912
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2024-08-15 (Thu, 15 Aug 2024)

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

  Log Message:
  -----------
  [flang] Inline minval/maxval over elemental/designate (#103503)

This PR intends to optimize away `hlfir.elemental` operations, which
leave temporary buffers (`allocmem`) in FIR. We typically see elemental
operations in the arguments of reduction intrinsics, so extending
`OptimizedBufferization` shall be the first solution to get heap-free
code.

Here we newly handle `minval`/`maxval` along with other reduction
intrinsics. Those functions over elemental become do loops. Furthermore,
we take the same action with `hlfir.designate` in order to inline more
intrinsics, which otherwise call runtime routines.



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