[llvm-branch-commits] [mlir] fa9851e - [MLIR] NFC: simplify PresburgerSet::isEqual

Arjun P via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Jan 18 09:21:33 PST 2021


Author: Arjun P
Date: 2021-01-18T22:47:25+05:30
New Revision: fa9851ebfee48014a1c48a7e7d625d9ecff3ebad

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

LOG: [MLIR] NFC: simplify PresburgerSet::isEqual

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D94918

Added: 
    

Modified: 
    mlir/lib/Analysis/PresburgerSet.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Analysis/PresburgerSet.cpp b/mlir/lib/Analysis/PresburgerSet.cpp
index 12df06b7221e..051010e09861 100644
--- a/mlir/lib/Analysis/PresburgerSet.cpp
+++ b/mlir/lib/Analysis/PresburgerSet.cpp
@@ -290,11 +290,8 @@ PresburgerSet PresburgerSet::subtract(const PresburgerSet &set) const {
 /// Therefore, S is equal to T iff S \ T and T \ S are both empty.
 bool PresburgerSet::isEqual(const PresburgerSet &set) const {
   assertDimensionsCompatible(set, *this);
-  PresburgerSet thisMinusSet = subtract(set);
-  if (!thisMinusSet.isIntegerEmpty())
-    return false;
-  PresburgerSet setMinusThis = set.subtract(*this);
-  return setMinusThis.isIntegerEmpty();
+  return this->subtract(set).isIntegerEmpty() &&
+         set.subtract(*this).isIntegerEmpty();
 }
 
 /// Return true if all the sets in the union are known to be integer empty,


        


More information about the llvm-branch-commits mailing list