[all-commits] [llvm/llvm-project] 6de613: [mlir] Optimize usage of llvm::mapped_iterator

River Riddle via All-commits all-commits at lists.llvm.org
Wed Nov 10 19:45:01 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6de6131f029d597188b05e666fb77fb69e5b936c
      https://github.com/llvm/llvm-project/commit/6de6131f029d597188b05e666fb77fb69e5b936c
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2021-11-11 (Thu, 11 Nov 2021)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h
    M llvm/unittests/ADT/MappedIteratorTest.cpp
    M mlir/include/mlir/IR/BuiltinAttributes.h
    M mlir/include/mlir/IR/Diagnostics.h
    M mlir/include/mlir/IR/DialectInterface.h
    M mlir/include/mlir/IR/TypeRange.h
    M mlir/include/mlir/IR/TypeUtilities.h
    M mlir/include/mlir/IR/UseDefLists.h
    M mlir/lib/IR/BuiltinAttributes.cpp
    M mlir/lib/IR/TypeUtilities.cpp

  Log Message:
  -----------
  [mlir] Optimize usage of llvm::mapped_iterator

mapped_iterator is a useful abstraction for applying a
map function over an existing iterator, but our current
usage ends up allocating storage/making indirect calls
even with the map function is a known function, which
is horribly inefficient. This commit refactors the usage
of mapped_iterator to avoid this, and allows for directly
referencing the map function when dereferencing.

Fixes PR52319

Differential Revision: https://reviews.llvm.org/D113511




More information about the All-commits mailing list