Skip to content

Fixed wrong check OperationEquivalenceTest.HashWorksWithFlags #142210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2025

Conversation

AviadCo
Copy link
Contributor

@AviadCo AviadCo commented May 30, 2025

The check was meant to check IgnoreProperties works as expected but operated on the wrong operation.

The check was meant to check `IgnoreProperties` works as expected but
operated on the wrong operation.
@llvmbot llvmbot added the mlir label May 30, 2025
@llvmbot
Copy link
Member

llvmbot commented May 30, 2025

@llvm/pr-subscribers-mlir

Author: Aviad Cohen (AviadCo)

Changes

The check was meant to check IgnoreProperties works as expected but operated on the wrong operation.


Full diff: https://github.com/llvm/llvm-project/pull/142210.diff

1 Files Affected:

  • (modified) mlir/unittests/IR/OperationSupportTest.cpp (+2-2)
diff --git a/mlir/unittests/IR/OperationSupportTest.cpp b/mlir/unittests/IR/OperationSupportTest.cpp
index b18512817969e..18ee9d71cb9fc 100644
--- a/mlir/unittests/IR/OperationSupportTest.cpp
+++ b/mlir/unittests/IR/OperationSupportTest.cpp
@@ -350,10 +350,10 @@ TEST(OperationEquivalenceTest, HashWorksWithFlags) {
   auto req2 = b.getI32IntegerAttr(60);
   Operation *opWithProperty2 = b.create<test::OpAttrMatch1>(
       b.getUnknownLoc(), req2, nullptr, nullptr, req2);
-  EXPECT_NE(getHash(op1, OperationEquivalence::None),
-            getHash(op2, OperationEquivalence::None));
   EXPECT_EQ(getHash(opWithProperty1, OperationEquivalence::IgnoreProperties),
             getHash(opWithProperty2, OperationEquivalence::IgnoreProperties));
+  EXPECT_NE(getHash(opWithProperty1, OperationEquivalence::None),
+            getHash(opWithProperty2, OperationEquivalence::None));
   opWithProperty1->destroy();
   opWithProperty2->destroy();
 }

@AviadCo AviadCo requested a review from krzysz00 May 30, 2025 20:28
@AviadCo
Copy link
Contributor Author

AviadCo commented May 30, 2025

@krzysz00 this small PR fixes wrongly check in #141664 PR (discovered by ASAN due to calling destroy to op1 & op2 twice in OperationEquivalenceTest.HashWorksWithFlags

@krzysz00 krzysz00 merged commit ab77a70 into llvm:main May 31, 2025
13 checks passed
@AviadCo AviadCo deleted the hash/fix-testing branch May 31, 2025 03:43
vitalybuka added a commit that referenced this pull request Jun 1, 2025
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jun 1, 2025
…ksWithFlags" (#142318)

Reverts llvm/llvm-project#142210

This is not enough, see #141664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants