[PATCH] D78875: [mlir] Optimize operand storage such that all operations can have resizable operand lists

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 26 16:59:41 PDT 2020


mehdi_amini added inline comments.


================
Comment at: mlir/lib/IR/OperationSupport.cpp:134
+      std::make_move_iterator(inlineOperands.begin()),
+      std::make_move_iterator(inlineOperands.end()));
+
----------------
rriddle wrote:
> mehdi_amini wrote:
> > Using a `std::vector` adds an extra indirection, you didn't think it was worth having a vector with inlined storage?
> I think it would be worth it, but I don't have an idea of a size that would be good to use in general. I'm deferring that until I can get a few benchmarks that can give me a good indicator here.
Why don't we just allocate inline always the number of operands initially and then grow to the next power of two when we run out of capacity?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78875





More information about the llvm-commits mailing list