summaryrefslogtreecommitdiff
path: root/flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp
AgeCommit message (Collapse)Author
2025-09-16[flang] fix some FIR verifiers that did not return expected failure (#158686)jeanPerier
Some `return` were missing before `emitOpError`, leading the compiler to print an error and continue, leading to the same error to be raised again and again at each verifier pass without a proper abort.
2025-08-27[flang] Added storage specification for [hl]fir.declare. (#155325)Slava Zakharin
As proposed in https://discourse.llvm.org/t/rfc-flang-representation-for-objects-inside-physical-storage/88026, this patch adds a `storage` Value operand and a `storage_offset` Integer attribute for `[hl]fir.declare` operations. The `storage` operand indicates the raw address of the physical storage a variable belongs to. This is the beginning address of the physical storage. The `storage_offset` specifies a byte offset within the physical storage where the variable object starts.
2024-07-02mlir/LogicalResult: move into llvm (#97309)Ramkumar Ramachandra
This patch is part of a project to move the Presburger library into LLVM.
2024-04-28Reapply "[mlir] Mark `isa/dyn_cast/cast/...` member functions depreca… ↵Christian Sigg
(#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-26Revert "[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. ↵dyung
(#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[mlir] Mark `isa/dyn_cast/cast/...` member functions deprecated. (#89998)Christian Sigg
See https://mlir.llvm.org/deprecation and https://discourse.llvm.org/t/preferred-casting-style-going-forward.
2022-12-17mlir/tblgen: use std::optional in generationRamkumar Ramachandra
This is part of an effort to migrate from llvm::Optional to std::optional. This patch changes the way mlir-tblgen generates .inc files, and modifies tests and documentation appropriately. It is a "no compromises" patch, and doesn't leave the user with an unpleasant mix of llvm::Optional and std::optional. A non-trivial change has been made to ControlFlowInterfaces to split one constructor into two, relating to a build failure on Windows. See also: https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716 Signed-off-by: Ramkumar Ramachandra <r@artagnon.com> Differential Revision: https://reviews.llvm.org/D138934
2022-11-14[flang] Add hlfir.declare operationJean Perier
This operation will be used to declare named variables in HLFIR. See the added description in HLFIROpBase.td for more info about it. The motivation behind this operation is described in https://reviews.llvm.org/D137634. The FortranVariableInterface verifier is changed a bit. It used to operate using the result type to verify the provided shape and length parameters. This is a bit incorrect because what matters to verify the information is the input address (This worked OK with fir.declare where the input memref type is the same as the output result). Also, not all operation defining variables will have an input memref with the same meaning (hlfir.designate and hlfir.associate for instance). Hence, this verifier is now optional and must be provided a memref to operate. Differential Revision: https://reviews.llvm.org/D137781
2022-11-09[flang][NFC] move fir namespace into FortranVariableOpInterface ODS declarationJean Perier
This will be needed to be able to use this interface in HLFIR ODS operation definition and get the right namespaces. Differential Revision: https://reviews.llvm.org/D137702
2022-10-19[flang] Add fir.declare operationJean Perier
Add fir.declare operation whose purpose was described in https://reviews.llvm.org/D134285. It uses the FortranVariableInterfaceOp for most of its logic (including the verifier). The rational is that all these aspects/logic will be shared by hlfir.designate and hlfir.associate. Its codegen and lowering will be added in later patches. Differential Revision: https://reviews.llvm.org/D136181
2022-10-19[flang] Introduce FortranVariableOpInterface for ops creating variableJean Perier
HLFIR will rely on certain operations to create SSA memory values that correspond to a Fortran variable. They will hold bounds and type parameters information as well as metadata (like Fortran attributes). This patch adds an interface that for such operations so that Fortran variable can be stored, manipulated, and queried regardless of what created them. This is so far intended for fir.declare, hlfir.designate and hlfir.associate operations. It is added to FIR and not HLFIR because fir.declare needs it and it does not itself needs any HLFIR concepts. Unit tests for the interface methods will be added alongside fir.declare in the next patch. Differential Revision: https://reviews.llvm.org/D136151