[PATCH] D113511: [mlir] Optimize usage of llvm::mapped_iterator
River Riddle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 16 11:40:39 PST 2021
rriddle added inline comments.
================
Comment at: llvm/include/llvm/ADT/STLExtras.h:310-312
+/// A base type of mapped iterator, that is useful for building derived
+/// iterators that do not need/want to store the map function (as in
+/// mapped_iterator). These iterators must simply provide a `mapElement` method
----------------
dblaikie wrote:
> Could this be implemented in mapped_iterator as an empty optimization if the mapping function happens to be stateless?
I think we can make it work for lambda callable types that capture no state. For non-lambdas I'm not sure though, given that we don't have a reference to the callable, just its type.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D113511/new/
https://reviews.llvm.org/D113511
More information about the llvm-commits
mailing list