[all-commits] [llvm/llvm-project] 9edf0e: [flang] improve array section analysis for WHERE (...
jeanPerier via All-commits
all-commits at lists.llvm.org
Tue Apr 28 01:14:44 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9edf0e73b59540ccec25b355268ebff6d3bba4ef
https://github.com/llvm/llvm-project/commit/9edf0e73b59540ccec25b355268ebff6d3bba4ef
Author: jeanPerier <jperier at nvidia.com>
Date: 2026-04-28 (Tue, 28 Apr 2026)
Changed paths:
M flang/include/flang/Optimizer/Analysis/ArraySectionAnalyzer.h
M flang/lib/Optimizer/Analysis/ArraySectionAnalyzer.cpp
M flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
A flang/test/HLFIR/order_assignments/where-equivalent-subscripts.fir
Log Message:
-----------
[flang] improve array section analysis for WHERE (#194399)
The array section analysis in the HLFIR pass in charge of WHERE lowering
was unable to tell that the LHS and RHS are the same array section when
the base is an assumed shape or when a variable is used as indices.
This patch adds an optional callback to the array section
analysis to tell if two SSA values have the same value. This call back
is then implemented to tell that two SSA values are the same only if:
they are the result of equivalent operations with no memory effect (ok
to be non speculatable) and with operands that have the same value
(recursively), or if they are the load from the same variable (which is
OK in the context of WHERE RHS/LHS thanks to Fortran 2023 10.1.4 that
guarantee that a variable referred both on the RHS and LHS cannot be
modified by side effects in the RHS/LHS).
Assisted by: Claude
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