55 Commits

Author SHA1 Message Date
Slava Zakharin
3bbb997d41 [flang] Disambiguate descriptor and data addresses in FIR AA. (#179774)
This change basically treats the descriptors' and data loads
as non-aliasing (with one exception) same way as we do it
for the purpose of the TBAA tags generation for LLVM
to do better optimizations. This change enables more LICM in Flang MLIR.
2026-02-05 16:21:57 -08:00
Jakub Kuderski
10c5d75623
[flang] Fix new clang-tidy warning llvm-type-switch-case-types. NFC. (#178512)
Pre-commiting this before landing the new check in
https://github.com/llvm/llvm-project/pull/177892
2026-01-28 16:07:23 -05:00
Slava Zakharin
930cac19c1
[flang] Fixed MemAlloc/Free effects handling in FIR ModRef. (#177728)
We should ignore MemAlloc/Free effects as they are not
modifying/reading ones. This is what LocalAliasAnalysis
does. This patch also removes the operation-wide MemFree
effect from `fir.freemem`.
2026-01-26 15:24:21 -08:00
Slava Zakharin
5d91c11df5
[flang] Support cuf.device_address in FIR AliasAnalysis. (#177518)
Support `cuf.device_address` same way as `fir.address_of`.
This implementation implies that the host address and the device
address `MustAlias` (as shown in the new test). This should be
conservatively correct as long as `MustAlias` does not allow
to assume that the actual addresses are the same (that is what
LLVM documentation implies, I believe).

It is probably worth adding an operation interface to handle
`fir::AddrOfOp` and `cuf::DeviceAddressOp` in FIR AliasAnalysis,
but for the initial implementation I hardcoded the checks.

I also removed the call to `fir::valueHasFirAttribute` that performs
on demand SymbolTable lookups, which may be costly, and added
SymbolTable caching in FIR AliasAnalysis object. Anyway,
`fir::valueHasFirAttribute` does not work for `cuf::DeviceAddressOp`.
2026-01-23 17:42:35 -08:00
Eugene Epshteyn
d593bcdc54
[flang] Changes to "unsafe Cray pointers" option (#175223)
Reserve "-funsafe-cray-pointers" (with "f") for the driver. In the
fir-alias-analysis use "-unsafe-cray-pointers" (without "f").

This prevents conflicts with how certain kinds of tools use the "unsafe
Cray pointers" options.
2026-01-10 19:33:30 -05:00
Slava Zakharin
0bf4df8b1e
[flang] Added LoopInvariantCodeMotion pass for [HL]FIR. (#173438)
The new pass allows hoisting some `fir.load` operations early
in MLIR. For example, many descriptor load might be hoisted
out of the loops, though it does not make much difference
in performance, because LLVM is able to optimize such loads
(which are lowered as `llvm.memcpy` into temporary descriptors),
given that proper TBAA information is generated by Flang.

Further hoisting improvements are possible in [HL]FIR LICM,
e.g. getting proper mod-ref results for Fortran runtime calls
may allow hoisting loads from global variables, which LLVM
cannot do due to lack of alias information.

This patch also contains improvements for FIR mod-ref analysis:
We may recurse into `HasRecursiveMemoryEffects` operations and
use `getModRef` recursively to get more precise results for
regions with `fir.call` operations.

This patch also modifies `AliasAnalysis` to set the instantiation
point for cases where the tracked data is accessed through a load
from `!fir.ref<!fir.box<>>`: without this change the mod-ref
analysis was not able to recognize user pointer/allocatable variables.
2026-01-07 16:16:52 -08:00
Slava Zakharin
cf6c26d4b4
[flang] FIR AliasAnalysis: two global TARGET vars cannot alias. (#172550)
I think this change should be equivalent to #170908 at MLIR level,
i.e. two distinct global variables cannot alias each other
even if they both have TARGET attribute.
2025-12-18 11:09:32 -08:00
Tom Eccles
54b4bd510a
[flang][AliasAnalysis] Cray pointers/pointees might alias with anything (#170900)
The LOC intrinsic allows a cray pointer to alias with ordinary variables
with no other attribute. See the new test for an example.

This is not enabled by default. The functionality can be used with
`-mmlir -funsafe-cray-pointers`.

First part of the un-revert of #169544. That will handle TBAA.
2025-12-10 15:32:27 +00:00
Slava Zakharin
be717af693
[NFC][flang] Introduce FortranObjectViewOpInterface. (#166841)
This patch adds initial version of `FortranObjectViewOpInterface`
that helps walking def-use chains containing "pass-through"
operations (like `fir.convert`, etc.). The new interface is used
in FIR AliasAnalysis to demonstrate potential usage (I know we have
such walks elsewhere in Flang, but I am only changing FIR AliasAnalysis
in this patch).

This is an NFC change. I noticed that if I remove followBoxData
code there are no failing LIT tests, but I decided to keep it
in order to keep the change looking more like NFC.

This change is a follow-up on the discussion in #164020:
it is unclear if the `FortranObjectViewOpInterface` methods and their
usage, as in this patch, apply to the ViewLike operations that
use the core MLIR `ViewLikeOpInterface`. So this patch is the path
towards simplifying Flang code while also enabling a future discussion
about having such an interface in core MLIR.
2025-11-13 12:19:03 -08:00
Susan Tan (ス-ザン タン)
bf3b704c60
[flang][NFC] Characterize allocation based on MemAlloc effect instead of pattern matching (#166806)
Flang alias analysis used to find allocation site by pattern matching
allocation ops in mainly FIR dialect. This MR extends the
characterization to instead characterize based on whether the result of
an op has MemAlloc effect.
2025-11-10 17:33:43 -05:00
Slava Zakharin
ee47aea435
[flang] Treat hlfir.associate as Allocate for FIR alias analysis. (#139004)
Early HLFIR optimizations may experience problems with values
produced by hlfir.associate. In most cases this is a unique
local memory allocation, but it can also reuse some other
hlfir.expr memory sometimes. It seems to be safe to assume
unique allocation for trivial types, since we always
allocate new memory for them.
2025-05-12 18:34:12 -07:00
Slava Zakharin
82c036e2de
[flang] Restructured TBAA trees in AddAliasTags pass. (#136725)
This patch produces the following TBAA tree for a function:
```
  Function root
  |
  "any access"
  |
  |- "descriptor member"
  |- "any data access"
     |
     |- "dummy arg data"
     |- "target data"
        |
        |- "allocated data"
        |- "direct data"
        |- "global data"
```
The TBAA tags are assigned using the following logic:
  * All POINTER variables point to the root of "target data".
  * Dummy arguments without POINTER/TARGET point to their
    leafs under "dummy arg data".
  * Dummy arguments with TARGET point to the root of "target data".
  * Global variables without descriptors point to their leafs under
    "global data" (including the ones with TARGET).
  * Global variables with descriptors point to their leafs under
    "direct data" (including the ones with TARGET).
  * Locally allocated variables point to their leafs under
   "allocated data" (including the ones with TARGET).

This change makes it possible to disambiguate globals like:
```
  module data
    real, allocatable :: a(:)
    real, allocatable, target :: b(:)
  end
```

Indeed, two direct references to global vars cannot alias
even if any/both of them have TARGET attribute.
In addition, the dummy arguments without POINTER/TARGET cannot alias
any other variable even with POINTER/TARGET. This was not expressed
in TBAA before this change.

As before, any "unknown" memory references (such as with Indirect
source, as classified by FIR alias analysis) may alias with
anything, as long as they point to the root of "any access".

Please think of the counterexamples for which this structure
may not work.
2025-04-29 10:17:11 -07:00
Slava Zakharin
86a03367bf
[flang] Support fir.pack_array in FIR alias analysis. (#131946)
`fir.pack_array` is just a pass-through op for the process
of finding the source in FIR alias analysis (as defined in #127147).
2025-04-21 08:59:41 -07:00
Renaud Kauffmann
718c4ed8a0
[flang] [NFCI] Using getSource instead of getOriginalDef (#128984)
As discussed in past MRs, this change removes the use of getOriginalDef
to use getSource instead to gather data from an indirection.
2025-03-07 08:47:42 -08:00
Joel E. Denny
976641062e
[flang][NFC] AliasAnalysis: Use Indirect not Unknown for LoadOp (#127845)
As mentioned at
<https://github.com/llvm/llvm-project/pull/126156#discussion_r1953523892>:
PR #126156 causes AliasAnalysis::getSource to sometimes return
SourceKind::Unknown when it used to return SourceKind::Indirect for a
LoadOp. This patch restores that part of the old behavior. It should not
affect user-visible behavior because AliasAnalysis::alias treats
SourceKind::Unknown and SourceKind::Indirect equivalently, but it does
improve debugging output.
2025-02-21 13:34:42 -05:00
Renaud Kauffmann
df9d3c20fa
Reverting commits 5bc51611446ee3a9fc353 and df427992da4492a664b6 (#128057) 2025-02-20 11:50:05 -08:00
Susan Tan (ス-ザン タン)
5bc5161144
[flang] Add support to fir::cg in alias analysis (#127827)
Currently the alias analysis doesn't trace the source whenever there are
operations from fir::cg dialect. This PR added support for
fir::cg::XEmboxOp, fir::cg::XReboxOp, fir::cg::XDeclareOp for a specific
application i'm working on.
2025-02-20 11:04:26 -08:00
Joel E. Denny
e7bf54d627
[flang] AliasAnalysis: Handle fir.load on hlfir.designate (#127107)
For example, determine that the address in `obj%p` below cannot alias
the address of `v`:

```
module m
  type :: ty
    real, pointer :: p
  end type ty
end module m
subroutine test()
  use m
  real, target :: t
  real :: v
  type(ty) :: obj
  obj%p => t
  v = obj%p
end subroutine test
```
2025-02-19 11:38:28 -05:00
Joel E. Denny
eb8ffd617a
[flang] AliasAnalysis: Handle fir.load on fir.alloca (#117785)
For example, determine that the address in p below cannot alias the
address of v:

```
subroutine test()
  real, pointer :: p
  real, target :: t
  real :: v
  p => t
  v = p
end subroutine test
```
2025-02-13 12:40:03 -05:00
Renaud Kauffmann
9d7177a2d7
[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@gmail.com>
2025-02-11 10:47:38 -08:00
Renaud Kauffmann
6dc41a6393
[flang][NFC] Moving alias analysis utilities utilities together. Adding new utility. (#125925)
1. Our static functions are a bit spread out in this file. I am
gathering them in an anonymous namespace
2. Moving the code to get the `target` attribute on a `fir.global` into
its own utility.
2025-02-06 12:18:51 -08:00
Dominik Adamski
5236e3dac5
[Flang][Alias analysis] Fix alias analysis for omp private allocatable item (#120243)
Flang alias analysis crashes for omp private allocatable item. The issue
is described here : https://github.com/llvm/llvm-project/issues/116954 .

We know that private value can't alias with anything else unless it is POINTER
or TARGET. That's why we can simplify alias analysis logic.
2025-01-02 20:18:55 +01:00
Tom Eccles
657c5bf807
[flang][AliasAnalysis] don't crash on load from blockarg (#120760)
Values can have no defining operation when the value is a blockarg. I
wrote this as a test for hlfir bufferization rather than alias analysis
because I couldn't find a way to add the test.ptr attribute to a block
argument.
2024-12-23 08:50:22 +00:00
jeanPerier
a871124f87
[flang][hlfir] optimize hlfir.eval_in_mem bufferization (#118069)
This patch extends the optimize bufferization to deal with the new
hlfir.eval_in_mem and move the evaluation contained in its body to
operate directly over the LHS when it can prove there are no access to
the LHS inside the region (and that the LHS is contiguous).

This will allow the array function call optimization when lowering is
changed to produce an hlfir.eval_in_mem in the next patch.
2024-12-03 09:59:43 +01:00
jeanPerier
cf602b95d1
[flang] handle fir.call in AliasAnalysis::getModRef (#117164)
fir.call side effects are hard to describe in a useful way using
`MemoryEffectOpInterface` because it is impossible to list which memory
location a user procedure read/write without doing a data flow analysis
of its body (even PURE procedures may read from any module variable,
Fortran SIMPLE procedure from F2023 will allow that, but they are far
from common at that point).

Fortran language specifications allow the compiler to deduce
that a procedure call cannot access a variable in many cases 
This patch leverages this to extend `fir::AliasAnalysis::getModRef` to
deal with fir.call.

This will allow implementing "array = array_function()" optimization in
a future patch.
2024-11-26 11:17:33 +01:00
Dominik Adamski
4213bca871
[flang][OpenMP] Add alias analysis for omp private (#115155)
Enable alias analysis for omp private clause for code:
```
program main
integer :: arrayA(10,10)
integer :: tmp(2)
integer :: i,j
!$omp target teams distribute parallel do private(tmp)
do j = 1, 10
  do i = 1,10
   tmp = [i,j]
   arrayA = tmp(1)
  end do
end do
end program main
```

This PR is based on: https://github.com/llvm/llvm-project/pull/113566
and it contains fix for Fujitsu test suite. Previous PR introduced
regression in Fujitsu test suite. For some Fujitsu test cases
`omp.yield` operation points to block argument. Alias analysis for such
MLIR code will be added in separate PR.
2024-11-12 11:08:33 +01:00
Susan Tan (ス-ザン タン)
57ab62a2aa
[flang] Add FIR AliasAnalysis alias() wrapper to allow external getSource() method (#115073)
Adding a wrapper around alias(mlir::Value lhs, mlir::Value rhs) to allow
user to provide Source objects.
2024-11-06 08:43:41 -08:00
Dominik Adamski
c0a7b60fd1
Revert "[flang][OpenMP] Add alias analysis for omp private" (#115135)
Reverts llvm/llvm-project#113566 (commit id: f3025c8b4fd797d99a8a8117254f93605ec46aa8 )
because of regression in Fujitsu compiler test suite.
2024-11-06 09:34:49 +01:00
Dominik Adamski
f3025c8b4f
[flang][OpenMP] Add alias analysis for omp private (#113566)
Enable alias analysis for omp private clause for code:

```
program main
integer :: arrayA(10,10)
integer :: tmp(2)
integer :: i,j
!$omp target teams distribute parallel do private(tmp)
do j = 1, 10
  do i = 1,10
   tmp = [i,j]
   arrayA = tmp(1)
  end do
end do
end program main
```
2024-11-05 13:56:11 +01:00
Joel E. Denny
732353303e
[flang] AliasAnalysis: Fix pointer component logic (#94242)
This PR applies the changes discussed in [[RFC] Rationale for Flang
AliasAnalysis pointer component
logic](https://discourse.llvm.org/t/rfc-rationale-for-flang-aliasanalysis-pointer-component-logic/79252).

In summary, this PR replaces the existing pointer component logic in
Flang's AliasAnalysis implementation. That logic focuses on aliasing
between pointers and non-pointer, non-target composites that have
pointer components. However, it is more conservative than necessary, and
some existing tests expect its current results when less conservative
results seem reasonable.

This PR splits the logic into two cases:

1. Source values are the same: Return MayAlias when one value is the
address of a composite, and the other value is statically the address of
a pointer component of that composite.
2. Source values are different: Return MayAlias when one value is the
address of a composite (actual argument), and the other value is the
address of a pointer (dummy arg) that might dynamically be a component
of that composite.

In both cases, the actual implementation is still more conservative than
described above, but it can be improved further later. Details appear in
the comments.

Additionally, this PR revises the logic that reports MayAlias for a
pointer/target vs. another pointer/target. It constrains the existing
logic to handle only isData cases, and it adds less conservative
handling of !isData cases elsewhere. First, it extends case 2 listed
above to cover the case where the actual argument is the address of a
pointer rather than a composite. Second, it adds a third case: where
target attributes enable aliasing with a dummy argument.
2024-10-15 10:07:17 -04:00
Dominik Adamski
102f76b2d7
[Flang][AliasAnalysis] Alias analysis for tmp arrays (#111972)
This patch extends the alias analysis for temporary arrays in Flang.
With this extension, Flang can now determine that the temporary array
[a, b, c] does not alias with arrayD in Fortran code:
```
  integer :: a, b, c
  integer :: arrayD(3)
  arrayD = [ a, b, c ]
```
2024-10-14 09:25:14 +02:00
Dominik Adamski
73ad416ebf
[OpenMP][Flang] Enable alias analysis inside omp target region (#111670)
At present, alias analysis does not work for operations inside OMP
target regions because the FIR declare operations within OMP target do
not offer sufficient information for alias analysis. Consequently, it is
necessary to examine the FIR code outside the OMP target region.
2024-10-11 11:53:28 +02:00
Joel E. Denny
54eb89fe74
[flang][NFC] AliasAnalysis: Prepare for PR #94242 (#105899)
This PR extracts several small NFC changes from PR #94242 to make it
more readable.
2024-08-26 13:29:00 +02:00
Slava Zakharin
6cd86d0fae
[flang] Use fir.declare/fir.dummy_scope for TBAA tags attachments. (#92472)
With MLIR inlining (e.g. `flang-new -mmlir -inline-all=true`)
the current TBAA tags attachment is suboptimal, because
we may lose information about the callee's dummy arguments
(by bypassing fir.declare in AliasAnalysis::getSource).
This is a conservative first step to improve the situation.
This patch makes AddAliasTagsPass to account for fir.dummy_scope
hierarchy after MLIR inlining and use it to place the TBAA tags
into TBAA trees corresponding to different function scopes.
The pass uses special mode of AliasAnalysis to find the instantiation
point of a Fortran variable (a [hl]fir.decalre) when searching
for the source of a memory reference. In this mode, AliasAnalysis
will always stop at fir.declare operations that have dummy_scope
operands - there should not be a reason to past throught it
for the purpose of TBAA tags attachment.
2024-06-04 08:33:40 -07:00
Kareem Ergawy
5bfc444524
[flang] Emit argNo debug info only for func block args (#93921)
Fixes a bug uncovered by
[pr43337.f90](https://github.com/llvm/llvm-test-suite/blob/main/Fortran/gfortran/regression/gomp/pr43337.f90)
in the test suite.

In particular, this emits `argNo` debug info only if the parent op of a
block is a `func.func` op. This avoids DI conflicts when a function
contains a nested OpenMP region that itself has block arguments with DI
attached to them; for example, `omp.parallel` with delayed privatization
enabled.
2024-06-03 11:33:00 +02:00
Renaud Kauffmann
ee407e17a3
[flang] AliasAnalysis: More formally define and distinguish between data and non-data (#91020)
This PR is an implementation for changes proposed in
https://discourse.llvm.org/t/rfc-distinguish-between-data-and-non-data-in-fir-alias-analysis/78759

Test updates were made when the query was on the wrong reference. So, it
is my hope that this will clear ambiguity on the nature of the queries
from here on.
There are also some TODOs that were addressed. 

It also partly implements what
https://github.com/llvm/llvm-project/pull/87723 is attempting to
accomplish. At least, on a point-to-point query between references, the
distinction is made. To apply it to TBAA, would be another PR.

Note that, the changes were minimal in the TBAA code to retain the
current results.
2024-05-16 08:49:44 -07:00
Tom Eccles
2f6c0e6e18
[flang][Alias Analysis] not all block arguments are dummy arguments (#92156)
Arguments to openmp regions should not be tagged as dummy arguments.
This is particularly unsafe because these openmp blocks will eventually
be inlined into the calling function, where they will trivially alias
with other values inside of the calling function.

This is probably a theoretical issue because the calls to openmp runtime
function calls would act as barriers, preventing optimizations that are
too aggressive. But a lot more thought would need to go into a bet like
that.

This came out of discussion on
https://github.com/llvm/llvm-project/pull/92036
2024-05-15 10:25:51 +01:00
Christian Sigg
fac349a169
Reapply "[mlir] Mark isa/dyn_cast/cast/... member functions depreca… (#90406)
…ted. (#89998)" (#90250)

This partially reverts commit 7aedd7dc754c74a49fe84ed2640e269c25414087.

This change removes calls to the deprecated member functions. It does
not mark the functions deprecated yet and does not disable the
deprecation warning in TypeSwitch. This seems to cause problems with
MSVC.
2024-04-28 22:01:42 +02:00
dyung
7aedd7dc75
Revert "[mlir] Mark isa/dyn_cast/cast/... member functions deprecated. (#89998)" (#90250)
This reverts commit 950b7ce0b88318f9099e9a7c9817d224ebdc6337.

This change is causing build failures on a bot
https://lab.llvm.org/buildbot/#/builders/216/builds/38157
2024-04-26 12:09:13 -07:00
Christian Sigg
950b7ce0b8
[mlir] Mark isa/dyn_cast/cast/... member functions deprecated. (#89998)
See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward.
2024-04-26 16:28:30 +02:00
Christian Sigg
57b2679051
Mark mlir::Value::isa/dyn_cast/cast/... member functions deprecated. (#89238)
See https://mlir.llvm.org/deprecation and
https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443/4
2024-04-22 10:05:37 +02:00
Valentin Clement (バレンタイン クレメン)
7d9c38a040
[flang][NFC] Remove hardcoded attr name for fir.global op (#81347)
These hardcoded attribute name are a leftover from the upstreaming
period when there was no way to get the attribute name without an
instance of the operation. It is since possible to do without them and
they should be removed to avoid duplication.

This PR cleanup the fir.global op of these hardcoded attribute name and
use their generated getters. Some other PRs will follow to cleanup other
operations.
2024-02-12 08:56:30 -08:00
Razvan Lupusoru
702664e787
[flang] Improve alias analysis to be precise for box and box.base_addr (#80335)
After PR#68727 the source for both the fir.box_addr and a box became the
same. Thus the detection that only one of the sources was direct and the
special logic around it was being skipped. As a result, the test
included would show a "MayAlias" result instead of a "NoAlias" result.
2024-02-05 07:45:46 -08:00
Tom Eccles
6242c8ca18 [flang] add TBAA tags to global and direct variables
These turn out to be useful for spec2017/fotonik3d and safe so long as
they are not used along side TBAA tags for local allocations. LLVM may
be able to figure out local allocations by itself anyway.

PR #68727
2023-10-25 10:47:51 +00:00
Slava Zakharin
f1ea831dbc
[flang][hlfir] Make alias analysis trace through box designators. (#67353)
The changes are needed to get leslie3d same performance with HLFIR
as with FIR lowering. The two module allocatable variables cannot
alias, so the optimized bufferization should be able to elide
the temporary and inline the assignment loop.
2023-09-25 11:27:28 -07:00
Renaud Kauffmann
575a648306
[flang] Follow memory source through more operations (#66713)
Add support for fir.box_addr, fir.array_corr, fir.coordinate, fir.embox,
fir.rebox and fir.load.

1) Through the use of boolean `followBoxAddr` determine whether the
analysis should apply to the address of the box or the address wrapped
by the box.
2) Some asserts have been removed to allow for more SourceKinds though
the flow, in a particular SourceKind::Direct
3) getSource was a public method but the returned type (SourceKind) was
not public making it impossible to be called publicly
4) About 12 tests have been added to check for real Fortran scenarios 
5) More tests will be added with HLFIR
6) A few TODOs have been identified and will need to be addressed in
follow-up patches. I felt that more changes would increase the
complexity of the patch.
2023-09-19 11:10:49 -07:00
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