[Mlir-commits] [mlir] fcc5755 - [mlir] Remove no-op array assignment in dictionaryAttrSort().

Christian Sigg llvmlistbot at llvm.org
Tue Apr 6 12:30:49 PDT 2021


Author: Christian Sigg
Date: 2021-04-06T21:30:37+02:00
New Revision: fcc57558783b12de7a7d2cea809f72705ea849b4

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

LOG: [mlir] Remove no-op array assignment in dictionaryAttrSort().

Reviewed By: rriddle

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

Added: 
    

Modified: 
    mlir/lib/IR/BuiltinAttributes.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp
index a7b1a6c1da140..8ef7c26741846 100644
--- a/mlir/lib/IR/BuiltinAttributes.cpp
+++ b/mlir/lib/IR/BuiltinAttributes.cpp
@@ -79,11 +79,9 @@ static bool dictionaryAttrSort(ArrayRef<NamedAttribute> value,
       storage.assign(value.begin(), value.end());
     // Check to see they are sorted already.
     bool isSorted = llvm::is_sorted(value);
-    if (!isSorted) {
-      // If not, do a general sort.
+    // If not, do a general sort.
+    if (!isSorted)
       llvm::array_pod_sort(storage.begin(), storage.end());
-      value = storage;
-    }
     return !isSorted;
   }
   return false;


        


More information about the Mlir-commits mailing list