summaryrefslogtreecommitdiff
path: root/mlir/test
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2023-05-14 22:39:50 -0700
committerMehdi Amini <joker.eph@gmail.com>2023-05-15 11:35:50 -0700
commitbbe5bf1788b55e3c7020d50ee0fd5956f261cfec (patch)
treed5d7024722fe341aa600d9f0d7bbbbfcdd59e4e6 /mlir/test
parent5b28e4d79175ae74dbd5043b494c21a87966fe81 (diff)
downloadllvm-bbe5bf1788b55e3c7020d50ee0fd5956f261cfec.tar.gz
Cleanup uses of getAttrDictionary() in MLIR to use getDiscardableAttrDictionary() when possible
This also speeds up some benchmarks in compiling simple fortan file by 2x! Fixes #62687 Differential Revision: https://reviews.llvm.org/D150540
Diffstat (limited to 'mlir/test')
-rw-r--r--mlir/test/lib/Dialect/Test/TestPatterns.cpp2
-rw-r--r--mlir/test/lib/IR/TestOperationEquals.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/mlir/test/lib/Dialect/Test/TestPatterns.cpp b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
index 82ae72ab6a27..3a1faeabe84c 100644
--- a/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+++ b/mlir/test/lib/Dialect/Test/TestPatterns.cpp
@@ -436,7 +436,7 @@ static void invokeCreateWithInferredReturnType(Operation *op) {
std::array<Value, 2> values = {{fop.getArgument(i), fop.getArgument(j)}};
SmallVector<Type, 2> inferredReturnTypes;
if (succeeded(OpTy::inferReturnTypes(
- context, std::nullopt, values, op->getAttrDictionary(),
+ context, std::nullopt, values, op->getDiscardableAttrDictionary(),
op->getPropertiesStorage(), op->getRegions(),
inferredReturnTypes))) {
OperationState state(location, OpTy::getOperationName());
diff --git a/mlir/test/lib/IR/TestOperationEquals.cpp b/mlir/test/lib/IR/TestOperationEquals.cpp
index ef3589636e52..03cf5f4facf8 100644
--- a/mlir/test/lib/IR/TestOperationEquals.cpp
+++ b/mlir/test/lib/IR/TestOperationEquals.cpp
@@ -31,7 +31,7 @@ struct TestOperationEqualPass
Operation *first = &module.getBody()->front();
llvm::outs() << first->getName().getStringRef() << " with attr "
- << first->getAttrDictionary();
+ << first->getDiscardableAttrDictionary();
OperationEquivalence::Flags flags{};
if (!first->hasAttr("strict_loc_check"))
flags |= OperationEquivalence::IgnoreLocations;