[flang] Add type-specific runtime entries for Minloc/Maxloc.
authorSlava Zakharin <szakharin@nvidia.com>
Mon, 10 Oct 2022 17:43:01 +0000 (10:43 -0700)
committerSlava Zakharin <szakharin@nvidia.com>
Mon, 10 Oct 2022 23:58:33 +0000 (16:58 -0700)
commit9f6aae46062e4f4e560cb3ae7a0110260a3c75da
tree07dad45786e12cd08738be8643ee15c10e2ba935
parenta43330b86f98a1901b84ea3b40859a10fb0ca8f8
[flang] Add type-specific runtime entries for Minloc/Maxloc.

We used to have a big switch statement over the type categories and kinds
inside Minloc/Maxloc. After D133051 the switch grew bigger, and this
changed inlining decisions made by GCC (the build compiler). Some of the
simple methods stopped being inlined, and this caused slight performance
regression in Polyhedron/gas_dyn2. This change adds separate entries
for real/integer data types to let them be optimized separately.

Differential Revision: https://reviews.llvm.org/D135610
flang/include/flang/Runtime/reduction.h
flang/lib/Optimizer/Builder/Runtime/Reduction.cpp
flang/runtime/extrema.cpp
flang/test/Lower/Intrinsics/maxloc.f90
flang/test/Lower/Intrinsics/minloc.f90
flang/unittests/Optimizer/Builder/Runtime/ReductionTest.cpp
flang/unittests/Optimizer/Builder/Runtime/RuntimeCallTestBase.h
flang/unittests/Runtime/Reduction.cpp