[all-commits] [llvm/llvm-project] ca7159: Reland "[Flang]Add support for inlining hlfir.assi...

Kaviya Rajendiran via All-commits all-commits at lists.llvm.org
Wed Jul 15 04:18:32 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca71592c415c2c1e6fe8289d4bcff934279d8315
      https://github.com/llvm/llvm-project/commit/ca71592c415c2c1e6fe8289d4bcff934279d8315
  Author: Kaviya Rajendiran <67495422+kaviya2510 at users.noreply.github.com>
  Date:   2026-07-15 (Wed, 15 Jul 2026)

  Changed paths:
    M flang/include/flang/Optimizer/Analysis/ArraySectionAnalyzer.h
    M flang/include/flang/Optimizer/Builder/FIRBuilder.h
    M flang/lib/Optimizer/Builder/FIRBuilder.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/InlineHLFIRAssign.cpp
    A flang/test/HLFIR/inline-hlfir-assign-pointer-overlap.fir
    A flang/test/HLFIR/inline-hlfir-assign-scalar-index.fir
    A flang/test/HLFIR/inline-hlfir-assign-self-copy-runtime-stride.fir
    A flang/test/HLFIR/inline-hlfir-assign-self-copy.fir
    A flang/test/Lower/inline-hlfir-assign-forall-threadprivate.f90
    A flang/test/Lower/inline-hlfir-assign-pointer-omp.f90

  Log Message:
  -----------
  Reland "[Flang]Add support for inlining hlfir.assign operation where both LHS and RHS are slices of the same array #204532" (#208159)

Added support for inlining hlfir.assign when both LHS and RHS are slices
of the same array. When overlap between the slices cannot be determined,
the pass introduces a disjointness check:

- genIndexBasedDisjointnessCheck(..) is used when both sides are
sections of the same array.
- genAddressBasedDisjointnessCheck(..) used as a fallback for more
complex cases.

At runtime:

- If the slices are disjoint, a direct element-wise copy is performed
without allocating a temporary buffer.
- If overlap is possible, a temporary buffer is allocated, the RHS is
first copied into it and then the data is copied from the temporary
buffer to the LHS.

Fixes https://github.com/llvm/llvm-project/issues/203228



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