[Mlir-commits] [mlir] b48833b - [MLIR] Make the verification order fixed in DynamicOpTraitList (#180758)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Feb 10 08:28:25 PST 2026


Author: Twice
Date: 2026-02-11T00:28:20+08:00
New Revision: b48833bf6619c49ed15390db4c36b217bcbf8a02

URL: https://github.com/llvm/llvm-project/commit/b48833bf6619c49ed15390db4c36b217bcbf8a02
DIFF: https://github.com/llvm/llvm-project/commit/b48833bf6619c49ed15390db4c36b217bcbf8a02.diff

LOG: [MLIR] Make the verification order fixed in DynamicOpTraitList (#180758)

Currently we use `DenseMap` in `DynamicOpTraitList` to store traits and
iterate over the `DenseMap`, and we found that the order is not fixed
and we also cannot control verification order.

In this PR we use `MapVector` to preserve the insertion order so that
the verification order over traits can be fixed and users can tune the
verification order.

Added: 
    

Modified: 
    mlir/include/mlir/IR/ExtensibleDialect.h

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/ExtensibleDialect.h b/mlir/include/mlir/IR/ExtensibleDialect.h
index 1021bd870d809..e52306f79378a 100644
--- a/mlir/include/mlir/IR/ExtensibleDialect.h
+++ b/mlir/include/mlir/IR/ExtensibleDialect.h
@@ -395,7 +395,7 @@ class DynamicOpTraitList {
   }
 
 private:
-  DenseMap<TypeID, std::unique_ptr<DynamicOpTrait>> traits;
+  llvm::MapVector<TypeID, std::unique_ptr<DynamicOpTrait>> traits;
 };
 
 template <template <typename T> class Trait>


        


More information about the Mlir-commits mailing list