Skip to content

Commit 86a25e8

Browse files
committed
[flang][NFC] turn (h)fir.declare side effect into debug ressource alloca
1 parent b81d8e9 commit 86a25e8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

flang/include/flang/Optimizer/Dialect/FIROps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3078,7 +3078,7 @@ def fir_IsPresentOp : fir_SimpleOp<"is_present", [NoMemoryEffect]> {
30783078
// debug information so we would like to keep this around even if the value
30793079
// is not used.
30803080
def fir_DeclareOp : fir_Op<"declare", [AttrSizedOperandSegments,
3081-
MemoryEffects<[MemWrite<DebuggingResource>]>,
3081+
MemoryEffects<[MemAlloc<DebuggingResource>]>,
30823082
DeclareOpInterfaceMethods<fir_FortranVariableOpInterface>]> {
30833083
let summary = "declare a variable";
30843084

flang/include/flang/Optimizer/HLFIR/HLFIROps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class hlfir_Op<string mnemonic, list<Trait> traits>
3636
// from the declare operation can be used to generate debug information so we
3737
// don't want to remove it as dead code
3838
def hlfir_DeclareOp : hlfir_Op<"declare", [AttrSizedOperandSegments,
39-
MemoryEffects<[MemWrite<DebuggingResource>]>,
39+
MemoryEffects<[MemAlloc<DebuggingResource>]>,
4040
DeclareOpInterfaceMethods<fir_FortranVariableOpInterface>]> {
4141
let summary = "declare a variable and produce an SSA value that can be used as a variable in HLFIR operations";
4242

0 commit comments

Comments
 (0)