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

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 07:59:56 PST 2024


Author: Orlando Cazalet-Hyams
Date: 2024-02-19T15:59:53Z
New Revision: bb56f052a37d9fa0a87c9636c1a94b85b72a52e0

URL: https://github.com/llvm/llvm-project/commit/bb56f052a37d9fa0a87c9636c1a94b85b72a52e0
DIFF: https://github.com/llvm/llvm-project/commit/bb56f052a37d9fa0a87c9636c1a94b85b72a52e0.diff

LOG: [RemoveDIs] Account for DPVAssigns in isIdenticalToWhenDefined (#82257)

AddressExpression wasn't included in the comparison.

Added: 
    

Modified: 
    llvm/include/llvm/IR/DebugProgramInstruction.h

Removed: 
    


################################################################################
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


        


More information about the llvm-commits mailing list