From fcc57558783b12de7a7d2cea809f72705ea849b4 Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Tue, 6 Apr 2021 15:43:49 +0200 Subject: [PATCH] [mlir] Remove no-op array assignment in dictionaryAttrSort(). Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D99954 --- mlir/lib/IR/BuiltinAttributes.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp index a7b1a6c1da14..8ef7c2674184 100644 --- a/mlir/lib/IR/BuiltinAttributes.cpp +++ b/mlir/lib/IR/BuiltinAttributes.cpp @@ -79,11 +79,9 @@ static bool dictionaryAttrSort(ArrayRef 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;