[all-commits] [llvm/llvm-project] 9d7177: [flang][NFCI] Stop tracking memory source after a ...
Renaud Kauffmann via All-commits
all-commits at lists.llvm.org
Tue Feb 11 10:48:00 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9d7177a2d7e63f90effea848e897cbf96690d154
https://github.com/llvm/llvm-project/commit/9d7177a2d7e63f90effea848e897cbf96690d154
Author: Renaud Kauffmann <rkauffmann at nvidia.com>
Date: 2025-02-11 (Tue, 11 Feb 2025)
Changed paths:
M flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
M flang/test/Analysis/AliasAnalysis/alias-analysis-2.fir
A flang/test/Analysis/AliasAnalysis/alias-analysis-target.fir
Log Message:
-----------
[flang][NFCI] Stop tracking memory source after a load in a more explicit manner. (#126156)
Typically, we do not track memory sources after a load because of the
dynamic nature of the load and the fact that the alias analysis is a
simple static analysis.
However, the code is written in a way that makes it seem like we are
continuing to track memory but in reality we are only doing so when we
know that the tracked memory is a leaf and therefore when there will
only be one more iteration through the switch statement. In other words,
we are iterating one more time, to gather data about a box, anticipating
that this will be the last time. This is a hack that helped avoid
cut-and-paste from other case statements but gives the wrong impression
about the intention of the code and makes it confusing.
To make it clear that there is no more tracking, we gather all the
necessary data from the memref of the load, in the case statement for
the load, and exit the loop. I am also limiting this data gathering for
the case when we load a box reference while we were actually following
data, as tests have shows, is the only case when we need it for. Other
cases will be handled conservatively, but this can change in the future,
on a case-by-case basis.
---------
Co-authored-by: Joel E. Denny <jdenny.ornl at gmail.com>
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