aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index 1b9740a..0b51382 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -1630,6 +1630,10 @@ AssignmentTrackingLowering::joinLocMap(const LocMap &A, const LocMap &B) {
unsigned IntersectSize = Join.size();
(void)IntersectSize;
+ // Check if A and B contain the same variables.
+ if (SymmetricDifference.empty() && A.size() == B.size())
+ return Join;
+
// Add the elements in B with variables that are not in A into
// SymmetricDifference.
for (const auto &Pair : B) {
@@ -1721,6 +1725,10 @@ AssignmentTrackingLowering::joinAssignmentMap(const AssignmentMap &A,
unsigned IntersectSize = Join.size();
(void)IntersectSize;
+ // Check if A and B contain the same variables.
+ if (SymmetricDifference.empty() && A.size() == B.size())
+ return Join;
+
// Add the elements in B with variables that are not in A into
// SymmetricDifference.
for (const auto &Pair : B) {