[llvm] [RemoveDIs] Account for DPVAssigns in isIdenticalToWhenDefined (PR #82257)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 07:57:33 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Orlando Cazalet-Hyams (OCHyams)

<details>
<summary>Changes</summary>

AddressExpression wasn't included in the comparison.

---
Full diff: https://github.com/llvm/llvm-project/pull/82257.diff


1 Files Affected:

- (modified) llvm/include/llvm/IR/DebugProgramInstruction.h (+4-5) 


``````````diff
diff --git a/llvm/include/llvm/IR/DebugProgramInstruction.h b/llvm/include/llvm/IR/DebugProgramInstruction.h
index a983280d2c4b9a..594f613aa8ed8b 100644
--- a/llvm/include/llvm/IR/DebugProgramInstruction.h
+++ b/llvm/include/llvm/IR/DebugProgramInstruction.h
@@ -271,16 +271,15 @@ class DPValue : public ilist_node<DPValue>, private DebugValueUser {
   std::optional<uint64_t> getFragmentSizeInBits() const;
 
   bool isEquivalentTo(const DPValue &Other) {
-    return std::tie(Type, DebugValues, Variable, Expression, DbgLoc) ==
-           std::tie(Other.Type, Other.DebugValues, Other.Variable,
-                    Other.Expression, Other.DbgLoc);
+    return DbgLoc == Other.DbgLoc && isIdenticalToWhenDefined(Other);
   }
   // Matches the definition of the Instruction version, equivalent to above but
   // without checking DbgLoc.
   bool isIdenticalToWhenDefined(const DPValue &Other) {
-    return std::tie(Type, DebugValues, Variable, Expression) ==
+    return std::tie(Type, DebugValues, Variable, Expression,
+                    AddressExpression) ==
            std::tie(Other.Type, Other.DebugValues, Other.Variable,
-                    Other.Expression);
+                    Other.Expression, Other.AddressExpression);
   }
 
   /// @name DbgAssign Methods

``````````

</details>


https://github.com/llvm/llvm-project/pull/82257


More information about the llvm-commits mailing list