Skip to content

Commit bb56f05

Browse files
authored
[RemoveDIs] Account for DPVAssigns in isIdenticalToWhenDefined (#82257)
AddressExpression wasn't included in the comparison.
1 parent 73f76cd commit bb56f05

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/include/llvm/IR/DebugProgramInstruction.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,16 +271,15 @@ class DPValue : public ilist_node<DPValue>, private DebugValueUser {
271271
std::optional<uint64_t> getFragmentSizeInBits() const;
272272

273273
bool isEquivalentTo(const DPValue &Other) {
274-
return std::tie(Type, DebugValues, Variable, Expression, DbgLoc) ==
275-
std::tie(Other.Type, Other.DebugValues, Other.Variable,
276-
Other.Expression, Other.DbgLoc);
274+
return DbgLoc == Other.DbgLoc && isIdenticalToWhenDefined(Other);
277275
}
278276
// Matches the definition of the Instruction version, equivalent to above but
279277
// without checking DbgLoc.
280278
bool isIdenticalToWhenDefined(const DPValue &Other) {
281-
return std::tie(Type, DebugValues, Variable, Expression) ==
279+
return std::tie(Type, DebugValues, Variable, Expression,
280+
AddressExpression) ==
282281
std::tie(Other.Type, Other.DebugValues, Other.Variable,
283-
Other.Expression);
282+
Other.Expression, Other.AddressExpression);
284283
}
285284

286285
/// @name DbgAssign Methods

0 commit comments

Comments
 (0)