[all-commits] [llvm/llvm-project] bac957: [flang] Reset all extents to zero for empty hlfir....

Slava Zakharin via All-commits all-commits at lists.llvm.org
Wed Jan 29 12:03:28 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bac95752748a46f3c2e9ebeda67e7df2ea642e07
      https://github.com/llvm/llvm-project/commit/bac95752748a46f3c2e9ebeda67e7df2ea642e07
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2025-01-29 (Wed, 29 Jan 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/include/flang/Optimizer/HLFIR/Passes.td
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
    A flang/test/HLFIR/elemental-with-empty-check-codegen.fir

  Log Message:
  -----------
  [flang] Reset all extents to zero for empty hlfir.elemental loops. (#124867)

An hlfir.elemental with a shape `(0, HUGE)` still runs `HUGE`
number of iterations when expanded into a loop nest.
HLFIR transformational operations inlined as hlfir.elemental
may execute slower comparing to Fortran runtime implementation.
This patch adds an option for BufferizeHLFIR pass to reset all
upper bounds in the elemental loop nests to zero, if the result
is an empty array.

A separate patch will enable this option in the driver after I do
more performance testing. The option is off by default now.



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