[PATCH] D112865: [mlir][core] Inline Intrinsic Attributes

Jeff Niu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 09:01:30 PST 2021


Mogball added inline comments.


================
Comment at: mlir/include/mlir/IR/OperationSupport.h:533
+class OpAttributeList {
+  /// Use SmallVector with zero inlined elements. SmallVector should use
+  /// `unsigned` as its size type.
----------------
jpienaar wrote:
> Not sure the unsigned comment make sense. Many also consider using unsigned to represent non-negative constraint as anti-pattern (see previous discussion on list).
In this case it's important to keep the size of Operation smaller. E.g. we use unsigned for the number of successors instead of size_t because it's half the size.

std::vector (by default) is 33% bigger than SmallVector because its size and capacity are 64 bit


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112865/new/

https://reviews.llvm.org/D112865



More information about the llvm-commits mailing list