Author: Qinkun Bao
Date: 2026-02-05T13:22:58-05:00
New Revision: 31e0e422231951a3fb261630d53d8215e1c9d083

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

LOG: Revert "[mlir][ExecutionEngine] Fix missing return from operator==() in 
`Owni…"

This reverts commit 14e50aa4c53e4ef1c3d3b6c31fd01815a0c1bfb6.

Added: 
    

Modified: 
    mlir/include/mlir/ExecutionEngine/MemRefUtils.h
    mlir/unittests/ExecutionEngine/CMakeLists.txt

Removed: 
    mlir/unittests/ExecutionEngine/OwningMemRef.cpp


################################################################################
diff  --git a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h 
b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
index c160a34207b2f..e9471731afe13 100644
--- a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
@@ -186,12 +186,11 @@ class OwningMemRef {
   }
   OwningMemRef(const OwningMemRef &) = delete;
   OwningMemRef &operator=(const OwningMemRef &) = delete;
-  OwningMemRef &operator=(OwningMemRef &&other) {
+  OwningMemRef &operator=(const OwningMemRef &&other) {
     freeFunc = other.freeFunc;
     descriptor = other.descriptor;
     other.freeFunc = nullptr;
     memset(&other.descriptor, 0, sizeof(other.descriptor));
-    return *this;
   }
   OwningMemRef(OwningMemRef &&other) { *this = std::move(other); }
 

diff  --git a/mlir/unittests/ExecutionEngine/CMakeLists.txt 
b/mlir/unittests/ExecutionEngine/CMakeLists.txt
index 3e563c65736f5..b83163e39c014 100644
--- a/mlir/unittests/ExecutionEngine/CMakeLists.txt
+++ b/mlir/unittests/ExecutionEngine/CMakeLists.txt
@@ -9,7 +9,6 @@ add_mlir_unittest(MLIRExecutionEngineTests
   DynamicMemRef.cpp
   StridedMemRef.cpp
   Invoke.cpp
-  OwningMemRef.cpp
 )
 
 mlir_target_link_libraries(MLIRExecutionEngineTests

diff  --git a/mlir/unittests/ExecutionEngine/OwningMemRef.cpp 
b/mlir/unittests/ExecutionEngine/OwningMemRef.cpp
deleted file mode 100644
index 3ce11431a305d..0000000000000
--- a/mlir/unittests/ExecutionEngine/OwningMemRef.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===- StridedMemRef.cpp ----------------------------------------*- C++ 
-*-===//
-//
-// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "mlir/ExecutionEngine/MemRefUtils.h"
-
-#include "gmock/gmock.h"
-
-using namespace ::mlir;
-using namespace ::testing;
-
-TEST(OwningMemRef, assignOverloadChaining) {
-  int64_t mem1Shape[] = {3};
-  int64_t mem2Shape[] = {4};
-
-  OwningMemRef<float, 1> mem1(mem1Shape);
-  OwningMemRef<float, 1> mem2(mem2Shape);
-  OwningMemRef<float, 1> &ref = (mem1 = std::move(mem2));
-
-  EXPECT_EQ(&ref, &mem1);
-}


        
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to