[flang-commits] [flang] [flang][FIR] allow mem2reg over fir.declare (PR #181848)
Abid Qadeer via flang-commits
flang-commits at lists.llvm.org
Fri Feb 20 04:14:28 PST 2026
================
@@ -3473,6 +3476,42 @@ def fir_DeclareOp
let hasVerifier = 1;
}
+def fir_DeclareValueOp
+ : fir_Op<"declare_value", [MemoryEffects<[MemAlloc<DebuggingResource>]>]> {
+ let summary = "declare a value";
+
+ let description = [{
+ Tie the properties of a simple scalar Fortran variable to a value.
+ The value must be a scalar integer, real, complex, or logical.
+ This is the value based version of fir.declare. It is used to keep track
+ of variable properties and debug info after mem2reg promotion.
+
+ Note that there is currently nothing that allows pinning this operation
+ relatively to the operation using the value of the variable,
+ this means that the when a mem2reg variable was assigned several
+ values, the variable value printed in the debugger at a given code
+ point main not be the actual value the variable had at that code point
----------------
abidh wrote:
```suggestion
point may not be the actual value the variable had at that code point
```
https://github.com/llvm/llvm-project/pull/181848
More information about the flang-commits
mailing list