9 Commits

Author SHA1 Message Date
Slava Zakharin
10388c74e2
[flang] Fixed -Werror build after #65919. (#66679) 2023-09-18 11:10:07 -07:00
Slava Zakharin
47025af639
[flang][hlfir] Alias analysis for host associated accesses. (#65919)
This patch adds `host_assoc` attribute for operations that implement
FortranVariableInterface (e.g. `hlfir.declare`). The attribute is used
by the alias analysis to make better conclusions about memory overlap.
For example, a dummy argument of an inner subroutine and a host's
variable used inside the inner subroutine cannot refer to the same
object (if the dummy argument does not satisify exceptions in F2018
15.5.2.13).
This closes a performance gap between HLFIR optimization pipeline
and FIR ArrayValueCopy for Polyhedron/nf.
2023-09-18 09:59:06 -07:00
Tom Eccles
c3f060b026 [flang] approximate alias analysis support for hlfir.designate
Add a rough alias analysis rule for hlfir.designate which just follows
the memref argument. This could be extended in the future to take into
account the indices or derived type fields accessed to spot for provably
non-overlapping cases. In the meantime, we need a flag to ensure we
never say "MustAlias" when following a value through a hlfir.designate
because the designate analysis is only approximate.

Differential Revision: https://reviews.llvm.org/D157718
2023-08-14 09:58:20 +00:00
Tom Eccles
6a0a19abf4 [flang] support (hl)fir.declare in alias analysis
Differential Revision: https://reviews.llvm.org/D157106
2023-08-10 14:16:37 +00:00
Tom Eccles
4492ec775c Revert "[flang] support (hl)fir.declare in alias analysis"
Reverting because of buildbot failure

This reverts commit c732a452ea15d4b7b682b35a72f78c1cdc13f60b.
2023-08-08 10:11:23 +00:00
Tom Eccles
c732a452ea [flang] support (hl)fir.declare in alias analysis
Differential Revision: https://reviews.llvm.org/D157106
2023-08-08 09:44:06 +00:00
Tom Eccles
d82a1581d6 [flang][nfc] Add debug prints to FIR alias analysis
These make it easier to debug and improve alias analysis. Enable with
--debug-only=fir-alias-analysis.

Differential Revision: https://reviews.llvm.org/D157105
2023-08-08 09:44:06 +00:00
Slava Zakharin
33a7f162d6 [flang] Added coarse grained alias analysis for FIR.
These are experimental changes in Flang AA to provide
at least some means to disambiguate memory accesses in some
simple cases. This AA is still not used by any transformation,
so the LIT tests are the only way to trigger it currently.
I will further look into applying this AA within Flang
to address some of the known performance issues in the benchmarks.

Credits to @Renaud-K for the initial implementation.

Differential Revision: https://reviews.llvm.org/D141410
2023-01-11 10:25:21 -08:00
Renaud-K
ba65584d15 Alias Analysis infra in Flang
Differential revision: https://reviews.llvm.org/D136889
2022-11-04 13:39:00 -07:00