summaryrefslogtreecommitdiff
path: root/mlir/unittests/IR/InterfaceTest.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riddleriver@gmail.com>2023-01-20 21:39:13 -0800
committerRiver Riddle <riddleriver@gmail.com>2023-01-27 15:28:03 -0800
commit03d136cf5f3f10b618b7e17f897ebf6019518dcc (patch)
tree77296a1eb9bdc726ea3b1f3b81012210694a37c1 /mlir/unittests/IR/InterfaceTest.cpp
parentf58de2125caf75ec0d40bc3e094a93c0b314a66a (diff)
downloadllvm-03d136cf5f3f10b618b7e17f897ebf6019518dcc.tar.gz
[mlir] Promote the SubElementInterfaces to a core Attribute/Type construct
This commit restructures the sub element infrastructure to be a core part of attributes and types, instead of being relegated to an interface. This establishes sub element walking/replacement as something "always there", which makes it easier to rely on for correctness/etc (which various bits of infrastructure want, such as Symbols). Attribute/Type now have `walk` and `replace` methods directly accessible, which provide power API for interacting with sub elements. As part of this, a new AttrTypeWalker class is introduced that supports caching walked attributes/types, and a friendlier API (see the simplification of symbol walking in SymbolTable.cpp). Differential Revision: https://reviews.llvm.org/D142272
Diffstat (limited to 'mlir/unittests/IR/InterfaceTest.cpp')
-rw-r--r--mlir/unittests/IR/InterfaceTest.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/mlir/unittests/IR/InterfaceTest.cpp b/mlir/unittests/IR/InterfaceTest.cpp
index e77e8794d696..9b20d3c1219e 100644
--- a/mlir/unittests/IR/InterfaceTest.cpp
+++ b/mlir/unittests/IR/InterfaceTest.cpp
@@ -41,24 +41,6 @@ TEST(InterfaceTest, OpInterfaceDenseMapKey) {
EXPECT_FALSE(opSet.contains(op3));
}
-TEST(InterfaceTest, AttrInterfaceDenseMapKey) {
- MLIRContext context;
- context.loadDialect<test::TestDialect>();
-
- OpBuilder builder(&context);
-
- DenseSet<SubElementAttrInterface> attrSet;
- auto attr1 = builder.getArrayAttr({});
- auto attr2 = builder.getI32ArrayAttr({0});
- auto attr3 = builder.getI32ArrayAttr({1});
- attrSet.insert(attr1);
- attrSet.insert(attr2);
- attrSet.erase(attr1);
- EXPECT_FALSE(attrSet.contains(attr1));
- EXPECT_TRUE(attrSet.contains(attr2));
- EXPECT_FALSE(attrSet.contains(attr3));
-}
-
TEST(InterfaceTest, TypeInterfaceDenseMapKey) {
MLIRContext context;
context.loadDialect<test::TestDialect>();