[Mlir-commits] [mlir] Revert "[mlir][ExecutionEngine] Fix missing return from operator==() in `OwningMemRef`" (PR #179999)

Qinkun Bao llvmlistbot at llvm.org
Thu Feb 5 10:23:46 PST 2026


https://github.com/qinkunbao created https://github.com/llvm/llvm-project/pull/179999

Reverts llvm/llvm-project#179655

Break 
https://lab.llvm.org/buildbot/#/builders/169/builds/19630
https://lab.llvm.org/buildbot/#/builders/24/builds/17229

>From 31e0e422231951a3fb261630d53d8215e1c9d083 Mon Sep 17 00:00:00 2001
From: Qinkun Bao <qinkun at google.com>
Date: Thu, 5 Feb 2026 13:22:58 -0500
Subject: [PATCH] =?UTF-8?q?Revert=20"[mlir][ExecutionEngine]=20Fix=20missi?=
 =?UTF-8?q?ng=20return=20from=20operator=3D=3D()=20in=20`Owni=E2=80=A6"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This reverts commit 14e50aa4c53e4ef1c3d3b6c31fd01815a0c1bfb6.
---
 .../mlir/ExecutionEngine/MemRefUtils.h        |  3 +--
 mlir/unittests/ExecutionEngine/CMakeLists.txt |  1 -
 .../ExecutionEngine/OwningMemRef.cpp          | 25 -------------------
 3 files changed, 1 insertion(+), 28 deletions(-)
 delete mode 100644 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);
-}



More information about the Mlir-commits mailing list