@@ -315,7 +315,6 @@ TEST(OperandStorageTest, PopulateDefaultAttrs) {
315315TEST (OperationEquivalenceTest, HashWorksWithFlags) {
316316 MLIRContext context;
317317 context.getOrLoadDialect <test::TestDialect>();
318- OpBuilder b (&context);
319318
320319 auto *op1 = createOp (&context);
321320 // `op1` has an unknown loc.
@@ -326,36 +325,12 @@ TEST(OperationEquivalenceTest, HashWorksWithFlags) {
326325 op, OperationEquivalence::ignoreHashValue,
327326 OperationEquivalence::ignoreHashValue, flags);
328327 };
329- // Check ignore location.
330328 EXPECT_EQ (getHash (op1, OperationEquivalence::IgnoreLocations),
331329 getHash (op2, OperationEquivalence::IgnoreLocations));
332330 EXPECT_NE (getHash (op1, OperationEquivalence::None),
333331 getHash (op2, OperationEquivalence::None));
334- op1->setLoc (NameLoc::get (StringAttr::get (&context, " foo" )));
335- // Check ignore discardable dictionary attributes.
336- SmallVector<NamedAttribute> newAttrs = {
337- b.getNamedAttr (" foo" , b.getStringAttr (" f" ))};
338- op1->setAttrs (newAttrs);
339- EXPECT_EQ (getHash (op1, OperationEquivalence::IgnoreDiscardableAttrs),
340- getHash (op2, OperationEquivalence::IgnoreDiscardableAttrs));
341- EXPECT_NE (getHash (op1, OperationEquivalence::None),
342- getHash (op2, OperationEquivalence::None));
343332 op1->destroy ();
344333 op2->destroy ();
345-
346- // Check ignore properties.
347- auto req1 = b.getI32IntegerAttr (10 );
348- Operation *opWithProperty1 = b.create <test::OpAttrMatch1>(
349- b.getUnknownLoc (), req1, nullptr , nullptr , req1);
350- auto req2 = b.getI32IntegerAttr (60 );
351- Operation *opWithProperty2 = b.create <test::OpAttrMatch1>(
352- b.getUnknownLoc (), req2, nullptr , nullptr , req2);
353- EXPECT_NE (getHash (op1, OperationEquivalence::None),
354- getHash (op2, OperationEquivalence::None));
355- EXPECT_EQ (getHash (opWithProperty1, OperationEquivalence::IgnoreProperties),
356- getHash (opWithProperty2, OperationEquivalence::IgnoreProperties));
357- opWithProperty1->destroy ();
358- opWithProperty2->destroy ();
359334}
360335
361336} // namespace
0 commit comments