[all-commits] [llvm/llvm-project] 2a95fe: [Flang] Allow Intrinsic simpification with min/max...

David Green via All-commits all-commits at lists.llvm.org
Sat Mar 2 06:40:11 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a95fe481d18e273b9654322135a08d7c2937536
      https://github.com/llvm/llvm-project/commit/2a95fe481d18e273b9654322135a08d7c2937536
  Author: David Green <david.green at arm.com>
  Date:   2024-03-02 (Sat, 02 Mar 2024)

  Changed paths:
    M flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
    M flang/test/Transforms/simplifyintrinsics.fir

  Log Message:
  -----------
  [Flang] Allow Intrinsic simpification with min/maxloc dim and scalar result (#81619)

This makes an adjustment to the existing fir minloc/maxloc generation
code to handle functions with a dim=1 that produce a scalar result. This
should allow us to get the same benefits as the existing generated
minmax reductions.

This is a recommit of #76194 with an extra alteration to the end of
genRuntimeMinMaxlocBody to make sure we convert the output array to the
correct type (a `box<heap<i32>>`, not `box<heap<array<1xi32>>>`) to
prevent writing the wrong type of box into it. This still allocates the
data as a `array<1xi32>`, converting it into a i32 assuming that is
safe. An alternative would be to allocate the data as a i32 and change
more of the accesses to it throughout genRuntimeMinMaxlocBody.



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