2791 Commits

Author SHA1 Message Date
Slava Zakharin
a0d699a8e6 Reland "[flang] Added noalias attribute to function arguments. (#140803)"
This helps to disambiguate accesses in the caller and the callee
after LLVM inlining in some apps. I did not see any performance
changes, but this is one step towards enabling other optimizations
in the apps that I am looking at.

The definition of llvm.noalias says:
```
... indicates that memory locations accessed via pointer values based on the argument or return value are not also accessed, during the execution of the function, via pointer values not based on the argument or return value. This guarantee only holds for memory locations that are modified, by any means, during the execution of the function.
```

I believe this exactly matches Fortran rules for the dummy arguments
that are modified during their subprogram execution.

I also set llvm.noalias and llvm.nocapture on the !fir.box<> arguments,
because the corresponding descriptors cannot be captured and cannot
alias anything (not based on them) during the execution of the
subprogram.
2025-05-29 13:42:57 -07:00
Kareem Ergawy
f8dcb059ae
[flang][fir][OpenMP] Refactor privtization code into shared location (#141767)
Refactors the utils needed to create privtization/locatization ops for
both the fir and OpenMP dialects into a shared location isolating OpenMP
stuff out of it as much as possible.
2025-05-29 13:13:44 +02:00
Kareem Ergawy
7e9887a50d
[flang] Generlize names of delayed privatization CLI flags (#138816)
Remove the `openmp` prefix from delayed privatization/localization flags
since they are now used for `do concurrent` as well.

PR stack:
- https://github.com/llvm/llvm-project/pull/137928
- https://github.com/llvm/llvm-project/pull/138505
- https://github.com/llvm/llvm-project/pull/138506
- https://github.com/llvm/llvm-project/pull/138512
- https://github.com/llvm/llvm-project/pull/138534
- https://github.com/llvm/llvm-project/pull/138816 (this PR)
2025-05-29 12:27:03 +02:00
Kareem Ergawy
e33cd9690f
[flang][fir] Basic PFT to MLIR lowering for do concurrent locality specifiers (#138534)
Extends support for `fir.do_concurrent` locality specifiers to the PFT
to MLIR level. This adds code-gen for generating the newly added
`fir.local` ops and referencing these ops from `fir.do_concurrent.loop`
ops that have locality specifiers attached to them. This reuses the
`DataSharingProcessor` component and generalizes it a bit more to allow
for handling `omp.private` ops and `fir.local` ops as well.


PR stack:
- https://github.com/llvm/llvm-project/pull/137928
- https://github.com/llvm/llvm-project/pull/138505
- https://github.com/llvm/llvm-project/pull/138506
- https://github.com/llvm/llvm-project/pull/138512
- https://github.com/llvm/llvm-project/pull/138534 (this PR)
- https://github.com/llvm/llvm-project/pull/138816
2025-05-29 11:04:27 +02:00
Valentin Clement (バレンタイン クレメン)
7b074fc936
[flang][openacc] Allow polymorphic entity in data clauses (#141856)
- Attach the mappable interface to ClassType
- Remove the TODO since derived type in descriptor can be handled as
other descriptors
2025-05-28 18:20:02 -07:00
Slava Zakharin
6ee2453360
Revert "[flang] Added noalias attribute to function arguments." (#141884)
Reverts llvm/llvm-project#140803

Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/143/builds/8041
2025-05-28 18:06:11 -07:00
Slava Zakharin
2426ac6865
[flang] Added noalias attribute to function arguments. (#140803)
This helps to disambiguate accesses in the caller and the callee
after LLVM inlining in some apps. I did not see any performance
changes, but this is one step towards enabling other optimizations
in the apps that I am looking at.

The definition of llvm.noalias says:
```
... indicates that memory locations accessed via pointer values based on the argument or return value are not also accessed, during the execution of the function, via pointer values not based on the argument or return value. This guarantee only holds for memory locations that are modified, by any means, during the execution of the function.
```

I believe this exactly matches Fortran rules for the dummy arguments
that are modified during their subprogram execution.

I also set llvm.noalias and llvm.nocapture on the !fir.box<> arguments,
because the corresponding descriptors cannot be captured and cannot
alias anything (not based on them) during the execution of the
subprogram.
2025-05-28 17:18:04 -07:00
Peter Klausler
145712555f
[flang] Allow forward reference to non-default INTEGER dummy (#141254)
A dummy argument with an explicit INTEGER type of non-default kind can
be forward-referenced from a specification expression in many Fortran
compilers. Handle by adding type declaration statements to the initial
pass over a specification part's declaration constructs. Emit an
optional warning under -pedantic.

Fixes https://github.com/llvm/llvm-project/issues/140941.
2025-05-28 14:01:28 -07:00
Peter Klausler
4c6b60a639
[flang] Extension: allow char string edit descriptors in input formats (#140624)
FORMAT("J=",I3) is accepted by a few other Fortran compilers as a valid
format for input as well as for output. The character string edit
descriptor "J=" is interpreted as if it had been 2X on input, causing
two characters to be skipped over. The skipped characters don't have to
match the characters in the literal string. An optional warning is
emitted under control of the -pedantic option.
2025-05-28 13:58:22 -07:00
Akash Banerjee
59b7b5b6b5
[OpenMP][Flang] Fix semantic check and scoping for declare mappers (#140560)
The current semantic check in place is incorrect, this patch fixes this.

Up to 1 **'default'** named mapper should be allowed for each derived
type.
The current semantic check only allows up to 1 **'default'** named
mapper across all derived types.

This also makes sure that declare mappers follow proper scoping rules
for both default and named mappers.

Co-authored-by: Raghu Maddhipatla <Raghu.Maddhipatla@amd.com>
2025-05-28 14:32:17 +01:00
Eugene Epshteyn
66a2d4b1e7
[flang] Ensure that the integer for Cray pointer is sized correctly (#140822)
The integer used for Cray pointers should have the size equivalent to
platform's pointer size.
2025-05-27 13:08:35 -04:00
MingYan
953302eb98
[flang][fir] Add FIR structured control flow ops to SCF dialect pass. (#140374)
This patch only supports the conversion from `fir.do_loop` to `scf.for`.
This pass is still experimental, and future work will focus on gradually
improving this conversion pass.

Co-authored-by: yanming <ming.yan@terapines.com>
2025-05-25 14:28:47 +08:00
Yang Zaizhou
5530474e3e
[Flang][OpenMP] fix crash on sematic error in atomic capture clause (#140710)
Fix a crash caused by an invalid expression in the atomic capture
clause, due to the `checkForSymbolMatch` function not accounting for
`GetExpr` potentially returning null.

Fix https://github.com/llvm/llvm-project/issues/139884
2025-05-23 07:15:10 -05:00
Jan Svoboda
3ea2cec732
[flang] Fix build after 9e306ad4 (#141134) 2025-05-22 13:51:20 -07:00
jeanPerier
1f5b6ae89f
[flang] optionally add lifetime markers to alloca created in stack-arrays (#140901)
Flang at Ofast usually produces executables that consume more stack that
other Fortran compilers.
This is in part because the alloca created from temporary heap
allocation by the StackArray pass are created at the function scope
level without lifetimes, and LLVM does not/is not able to merge alloca
that do not have overlapping lifetimes.

This patch adds an option to generate LLVM lifetime in the StackArray
pass at the previous heap allocation/free using the LLVM dialect
operation for it.
2025-05-22 09:26:14 +02:00
Sebastian Pop
d36028120a
[flang] add -floop-interchange and enable it with opt levels (#140182)
Enable the use of -floop-interchange from the flang driver.
Enable in flang LLVM's loop interchange at levels -O2, -O3, -Ofast, and -Os.
2025-05-21 08:27:39 -05:00
jeanPerier
ed07412888
[flang] translate derived type array init to attribute if possible (#140268)
This patch relies on #140235 and #139724 to speed-up compilations of
files with derived type array global with initial value.
Currently, such derived type global init was lowered to an
llvm.mlir.insertvalue chain in the LLVM IR dialect because there was no
way to represent such value via attributes.

This chain was later folded in LLVM dialect to LLVM IR using LLVM IR
(not dialect) folding. This insert chain generation and folding is very
expensive for big arrays. For instance, this patch brings down the
compilation of FM_lib fmsave.f95 from 50s
to 0.5s.
2025-05-20 16:11:27 +02:00
Scott Manley
a6303099fd
[OpenACC] unify reduction and private-like init region recipes (#140652)
Between firstprivate, private and reduction init regions, the difference
is largely whether or not the temp that is created is initialized or
not. Some recent fixes were made to privatization (#135698, #137869) but
did not get propagated to reductions, even though they need to return
the yield the same things from their init regions.

To mitigate this discrepancy in the future, refactor the init region
recipes so they can be shared between the three recipe ops.

Also add "none" to the OpenACC_ReductionOperator enum for better error
checking.
2025-05-20 05:27:09 -05:00
shivaramaarao
32a1b6a70b
[flang][veclib] Adding AMDLIBM target to fveclib (#140533)
This commit adds AMDLIBM support to fveclib targets. The support is
already present in clang and this patch extends it to flang.
2025-05-20 01:38:35 -07:00
Valentin Clement (バレンタイン クレメン)
f5609aa1b0
[flang][cuda] Use a reference for asyncObject (#140614)
Switch from `int64_t` to `int64_t*` to fit with the rest of the
implementation.

New tentative with some fix. The previous was reverted some time ago.

Reviewed in #138010
2025-05-19 15:02:53 -07:00
jeanPerier
416b7dfaa0
[flang] use DataLayout instead of GEP to compute element size (#140235)
Now that the datalayout is part of codegen, use that to generate type
size constants in codegen instead of generating GEP.
2025-05-19 13:59:09 +02:00
Peter Klausler
c26e7520a9
[flang] Support -D for function-like macros (#139812)
Handle a command-line function-like macro definition like
"-Dfoo(a)=...".

TODO: error reporting for badly formed argument lists.
2025-05-15 11:26:03 -07:00
Asher Mancinelli
ed572aaac8
[flang] Add missing copy assignment operator (#139966)
On Clang 17 the implicit copy assignment operator was issuing a warning because of the user-declared copy constructor. Declare the copy assignment operator as default.
2025-05-15 07:06:50 -07:00
Sergio Afonso
7e8b3fea43
[Flang] Add missing dependent dialects to MLIR passes (#139260)
This patch updates several passes to include the DLTI dialect, since
their use of the `fir::support::getOrSetMLIRDataLayout()` utility
function could, in some cases, require this dialect to be loaded in
advance.

Also, the `CUFComputeSharedMemoryOffsetsAndSize` pass has been updated
with a dependency to the GPU dialect, as its invocation to
`cuf::getOrCreateGPUModule()` would result in the same kind of error if
no other operations or attributes from that dialect were present in the
input MLIR module.
2025-05-13 16:17:49 +01:00
Peter Klausler
53f0367ab0
[flang] Fix spurious error on defined assignment in PURE (#139186)
An assignment to a whole polymorphic object in a PURE subprogram that is
implemented by means of a defined assignment procedure shouldn't be
subjected to the same definability checks as it would be for an
intrinsic assignment (which would also require it to be allocatable).

Fixes https://github.com/llvm/llvm-project/issues/139129.
2025-05-13 07:48:54 -07:00
Peter Klausler
e75fda107d
[flang] Acknowledge non-enforcement of C7108 (#139169)
Fortran 2023 constraint C7108 prohibits the use of a structure
constructor in a way that is ambiguous with a generic function reference
(intrinsic or user-defined). Sadly, no Fortran compiler implements this
constraint, and the common portable interpretation seems to be the
generic resolution, not the structure constructor.

Restructure the processing of structure constructors in expression
analysis so that it can be driven both from the parse tree as well as
from generic resolution, and then use it to detect ambigous structure
constructor / generic function cases, so that a portability warning can
be issued. And document this as a new intentional violation of the
standard in Extensions.md.

Fixes https://github.com/llvm/llvm-project/issues/138807.
2025-05-13 07:48:30 -07:00
Peter Klausler
2ca2e1c9d5
[flang] Tune warning about incompatible implicit interfaces (#136788)
The compiler was emitting a warning about incompatible shapes being used
for two calls to the same procedure with an implicit interface when one
passed a whole array and the other passed a scalar. When the scalar is a
whole element of a contiguous array, however, we must allow for storage
association and not flag it as being a problem.
2025-05-13 07:48:05 -07:00
Pranav Bhandarkar
8a9e767fa6
[Flang][MLIR] - Handle the mapping of subroutine arguments when they are subsequently used inside the region of an omp.target Op (#134967)
This is a fix for https://github.com/llvm/llvm-project/issues/134912
which is a problem with mapping `fir.boxchar<k>` type values to the
target i.e an `omp.target` op.

There really are two problems. Fixing the first exposed the second. The
first problem is that OpenMP lowering of maps in `omp.target` in Flang
cannot handle the mapping of a value that doesnt have a defining
operation. In other words, a value that is a block argument. This is handled
by mapping the value using a `MapInfoOp`.
The second problem this fixes is that it adds bounds to `omp.map.info`
ops that map `fir.char<k, ?>` types by extracting the length from the
corresponding `fir.boxchar`
2025-05-12 22:34:58 -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
2d12d31f44
[flang] Propagate contiguous attribute through HLFIR. (#138797)
This change allows marking more designators producing an opaque
box with 'contiguous' attribute, e.g. like in test1 case
in flang/test/HLFIR/propagate-contiguous-attribute.fir.
This would make isSimplyContiguous() return true for such
designators allowing merging hlfir.eval_in_mem with hlfir.assign
where the LHS is a contiguous array section.

Depends on #139003
2025-05-12 18:33:47 -07:00
Peter Klausler
58535e81dd
[flang] Further refinement of OpenMP !$ lines in -E mode (#138956)
Address failing Fujitsu test suite cases that were broken by the patch
to defer the handling of !$ lines in -fopenmp vs. normal compilation to
actual compilation rather than processing them immediately in -E mode.

Tested on the samples in the bug report as well as all of the Fujitsu
tests that I could find that use !$ lines.

Fixes https://github.com/llvm/llvm-project/issues/136845.
2025-05-12 12:16:05 -07:00
Peter Klausler
ea87d7c0db
[flang] Add control and a portability warning for an extension (#137995)
This compiler allows an element of an assumed-shape array or POINTER to
be used in sequence association as an actual argument, so long as the
array is declared to have the CONTIGUOUS attribute.

Make sure that this extension is under control of a LanguageFeature
enum, so that a hypothetical compiler driver option could disable it,
and add an optional portability warning for its use.
2025-05-12 12:15:24 -07:00
Peter Klausler
9f8ff4b77d
[flang] Revamp evaluate::CoarrayRef (#136628)
Bring the typed expression representation of a coindexed reference up to
F'2023, which removed some restrictions that had allowed the current
representation to suffice for older revisions of the language. This new
representation is somewhat more simple -- it uses a DataRef as its base,
so any subscripts in a part-ref can be represented as an ArrayRef there.

Update the code that creates the CoarrayRef, and add more checking to
it, as well as actually capturing any STAT=, TEAM=, & TEAM_NUMBER=
specifiers that might appear. Enforce the constraint that the part-ref
must have subscripts if it is an array. (And update a pile of
copied-and-pasted test code that lacked such subscripts.)
2025-05-12 12:02:15 -07:00
agozillon
f687ed9ff7
[Flang][OpenMP] Initial defaultmap implementation (#135226)
This aims to implement most of the initial arguments for defaultmap
aside from firstprivate and none, and some of the more recent OpenMP 6
additions which will come in subsequent updates (with the OpenMP 6
variants needing parsing/semantic support first).
2025-05-12 16:30:43 +02:00
Andre Kuhlenschmidt
4d9479fa8f
[flang][openacc] Allow open acc routines from other modules. (#136012)
OpenACC routines annotations in separate compilation units currently get
ignored, which leads to errors in compilation. There are two reason for
currently ignoring open acc routine information and this PR is
addressing both.
- The module file reader doesn't read back in openacc directives from
module files.
  - Simple fix in `flang/lib/Semantics/mod-file.cpp`
- The lowering to HLFIR doesn't generate routine directives for symbols
imported from other modules that are openacc routines.
- This is the majority of this diff, and is address by the changes that
start in `flang/lib/Lower/CallInterface.cpp`.
2025-05-09 11:12:24 -07:00
Krzysztof Parzyszek
a68f35a17d [flang][OpenMP] Pass OpenMP version to getOpenMPDirectiveName (#139131)
The OpenMP version is stored in LangOptions in SemanticsContext. Use the
fallback version where SemanticsContext is unavailable (mostly in case
of debug dumps).

RFC:
https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507

Reland with a fix for build break in f18-parse-demo.
2025-05-09 08:13:52 -05:00
Krzysztof Parzyszek
89822ff5a8 Revert "[flang][OpenMP] Pass OpenMP version to getOpenMPDirectiveName (#139131)"
This reverts commit 41aa67488c3ca33334ec79fb5216145c3644277c.

Breaks build: https://lab.llvm.org/buildbot/#/builders/140/builds/22826
2025-05-09 07:56:10 -05:00
Krzysztof Parzyszek
41aa67488c
[flang][OpenMP] Pass OpenMP version to getOpenMPDirectiveName (#139131)
The OpenMP version is stored in LangOptions in SemanticsContext. Use the
fallback version where SemanticsContext is unavailable (mostly in case
of debug dumps).

RFC:
https://discourse.llvm.org/t/rfc-alternative-spellings-of-openmp-directives/85507
2025-05-09 07:42:15 -05:00
agozillon
b291cfcad4
[Flang][OpenMP] Generate correct present checks for implicit maps of optional allocatables (#138210)
Currently, we do not generate the appropriate checks to check if an
optional
allocatable argument is present before accessing relevant components of
it,
in particular when creating bounds, we must generate a presence check
and we
must make sure we do not generate/keep an load external to the presence
check
by utilising the raw address rather than the regular address of the info
data structure.

Similarly in cases for optional allocatables we must treat them like
non-allocatable
arguments and generate an intermediate allocation that we can have as a
location
in memory that we can access later in the lowering without causing
segfaults when
we perform "mapping" on it, even if the end result is an empty
allocatable
(basically, we shouldn't explode if someone tries to map a non-present
optional,
similar to C++ when mapping null data).
2025-05-09 13:57:45 +02:00
Sergio Afonso
4923cffc1d
[Flang] Add missing dependency to AddDebugInfo pass (#139099)
The `AddDebugInfo` pass currently has a dependency on the `DLTI` MLIR
dialect caused by a call to the `fir::support::getOrSetMLIRDataLayout()`
utility function.

This dependency is not captured in the pass definition. This patch adds
the dependency and simplifies several unit tests that had to explicitly
use the `DLTI` dialect to prevent the missing dependency from causing
compiler failures.
2025-05-09 12:19:53 +01:00
jeanPerier
92d2e13b99
[flang][driver] do not crash when fc1 process multiple files (#138875)
This is a fix for the issue https://github.com/llvm/llvm-project/issues/137126
that turned out to be a driver issue.

FrontendActions has a loop to process multiple input files and `flang -fc1`
accept multiple files, but the semantic, lowering, and llvm codegen
actions were not re-entrant, and crash or weird behaviors occurred
when processing multiple files with `-fc1`. 

This patch makes the actions reentrant by cleaning-up the contexts/modules
if needed on entry.
2025-05-09 10:36:38 +02:00
Kareem Ergawy
227e1ff73b
[flang][fir] Add locality specifiers modeling to fir.do_concurrent.loop (#138506) 2025-05-08 21:42:52 +02:00
Asher Mancinelli
30f7a6cc42
[flang] Correctly prepare allocatable runtime call arguments (#138727)
When lowering allocatables, the generated calls to runtime functions
were not using the runtime::createArguments utility which handles the
required conversions. createArguments is where I added the implicit
volatile casts to handle converting volatile variables to the
appropriate type based on their volatility in the callee. Because the
calls to allocatable runtime functions were not using this function,
their arguments were not casted to have the appropriate volatility.

Add a test to demonstrate that volatile and allocatable
class/box/reference types are appropriately casted before calling into
the runtime library.

Instead of using a recursive variadic template to perform the
conversions in createArguments, map over the arguments directly so that
createArguments can be called with an ArrayRef of arguments. Some cases
in Allocatable.cpp already had a vector of values at the point where
createArguments needed to be called - the new overload allows calling
with a vector of args or the variadic version with each argument spelled
out at the callsite.

This change resulted in the allocatable runtime calls having their
arguments converted left-to-right, which changed some of the test
results. I used CHECK-DAG to ignore the order.

Add some missing handling of volatile class entities, which I previously
missed because I had not yet enabled volatile class entities in Lower.
2025-05-08 06:36:39 -07:00
Kareem Ergawy
a83bb35e99
[flang][fir] Add fir.local op for locality specifiers (#138505)
Adds a new `fir.local` op to model `local` and `local_init` locality
specifiers. This op is a clone of `omp.private`. In particular, this new
op also models the privatization/localization logic of an SSA value in
the `fir` dialect just like `omp.private` does for OpenMP.

PR stack:
- https://github.com/llvm/llvm-project/pull/137928
- https://github.com/llvm/llvm-project/pull/138505 (this PR)
- https://github.com/llvm/llvm-project/pull/138506
- https://github.com/llvm/llvm-project/pull/138512
- https://github.com/llvm/llvm-project/pull/138534
- https://github.com/llvm/llvm-project/pull/138816
2025-05-07 14:00:06 +02:00
Tom Eccles
75e5643abf
[flang][OpenMP] share global variable initialization code (#138672)
Fixes #108136

In #108136 (the new testcase), flang was missing the length parameter
required for the variable length string when boxing the global variable.
The code that is initializing global variables for OpenMP did not
support types with length parameters.

Instead of duplicating this initialization logic in OpenMP, I decided to
use the exact same initialization as is used in the base language
because this will already be well tested and will be updated for any new
types. The difference for OpenMP is that the global variables will be
zero initialized instead of left undefined.

Previously `Fortran::lower::createGlobalInitialization` was used to
share a smaller amount of the logic with the base language lowering. I
think this bug has demonstrated that helper was too low level to be
helpful, and it was only used in OpenMP so I have made it static inside
of ConvertVariable.cpp.
2025-05-07 10:18:13 +01:00
Kiran Chandramohan
a13c0b6770
[Flang][OpenMP] Add frontend support for declare variant (#130578)
Support is added for parsing. Basic semantics support is added to
forward the code to Lowering. Lowering will emit a TODO error. Detailed
semantics checks and lowering is further work.
2025-05-07 09:56:45 +01:00
Kaviya Rajendiran
9e7d529607
[Flang][OpenMP]Support for lowering task_reduction and in_reduction to MLIR (#111155)
This patch,
- Added support for lowering of task_reduction to MLIR
- Added support for lowering of in_reduction to MLIR
- Fixed incorrect DSA handling for variables in the presence of 'in_reduction' clause.
2025-05-07 10:25:56 +05:30
Krzysztof Parzyszek
304c7a87d0
[flang][Evaluate] Restrict ConstantBase constructor overload (#138456)
ConstantBase has a constructor that takes a value of any type as an
input: template <typename T> ConstantBase(const T &). A derived type
Constant<T> is a member of many Expr<T> classes (as an alternative in
the member variant).

When trying (erroneously) to create Expr<T> from a wrong input, if the
specific instance of Expr<T> contains Constant<T>, it's that constructor
that will be instantiated, leading to cryptic and confusing errors.

Eliminate the constructor from overload for invalid input values to help
produce more meaningful diagnostics.
2025-05-06 12:00:29 -05:00
Krzysztof Parzyszek
96e09302f9
[flang][Evaluate] Fix AsGenericExpr for Relational (#138455)
The variant in Expr<Type<TypeCategory::Logical, KIND>> only contains
Relational<SomeType>, not other, more specific Relational<T> types.

When calling AsGenericExpr for a value of type Relational<T>, the AsExpr
function will attempt to create Expr<> directly for Relational<T>, which
won't work for the above reason.

Implement an overload of AsExpr for Relational<T>, which will wrap the
Relational<T> in Relational<SomeType> before creating Expr<>.
2025-05-06 11:59:22 -05:00
Asher Mancinelli
7220fdad0c
[flang] Hide strict volatility checks behind flag (#138183)
Enabling volatility lowering by default revealed some issues in lowering
and op verification.

For example, given volatile variable of a nested type, accessing
structure members of a structure member would result in a volatility
mismatch when the inner structure member is designated (and thus a
verification error at compile time).

In other cases, I found correct codegen when the checks were disabled,
also related to allocatable types and how we handle volatile references
of boxes.

This hides the strict verification of fir and hlfir ops behind a flag so
I can iteratively improve lowering of volatile variables without causing
compile-time failures, keeping the strict verification on when running
tests.
2025-05-02 09:03:20 -07:00