[PATCH] D78064: [llvm][STLExtras] Move various iterator/range utilities from MLIR to LLVM

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 16:52:54 PDT 2020


rriddle created this revision.
rriddle added a reviewer: lattner.
Herald added subscribers: llvm-commits, frgossen, grosul1, bader, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, csigg, nicolasvasilache, antiagainst, shauheen, burmako, jpienaar, mehdi_amini, arphaman, dexonsmith, mgorny.
Herald added a reviewer: mravishankar.
Herald added a reviewer: antiagainst.
Herald added a reviewer: nicolasvasilache.
Herald added a reviewer: herhut.
Herald added a project: LLVM.

This revision moves the various range utilities present in MLIR to LLVM to enable greater reuse. This revision moves the following utilities:

- indexed_accessor_*

This is set of utility iterator/range base classes that allow for building a range class where the iterators are represented by an object+index pair.

- make_second_range

Given a range of pairs, returns a range iterating over the `second` elements.

- has_single_element

Returns if the given range has 1 element. size() == 1 checks end up being very common, but size() is not always O(1) (e.g., ilist). This method provides O(1) checks for those cases.

Depends On D78059 <https://reviews.llvm.org/D78059>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78064

Files:
  llvm/include/llvm/ADT/STLExtras.h
  llvm/unittests/Support/CMakeLists.txt
  llvm/unittests/Support/IndexedAccessorTest.cpp
  mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
  mlir/include/mlir/IR/Attributes.h
  mlir/include/mlir/IR/BlockSupport.h
  mlir/include/mlir/IR/OpImplementation.h
  mlir/include/mlir/IR/OperationSupport.h
  mlir/include/mlir/IR/Region.h
  mlir/include/mlir/IR/UseDefLists.h
  mlir/include/mlir/Support/STLExtras.h
  mlir/lib/Dialect/Affine/IR/AffineOps.cpp
  mlir/lib/Dialect/GPU/Transforms/MemoryPromotion.cpp
  mlir/lib/Dialect/Linalg/Utils/Utils.cpp
  mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
  mlir/lib/Dialect/StandardOps/IR/Ops.cpp
  mlir/lib/IR/Attributes.cpp
  mlir/lib/IR/Module.cpp
  mlir/lib/IR/OperationSupport.cpp
  mlir/lib/IR/Region.cpp
  mlir/lib/IR/SymbolTable.cpp
  mlir/lib/Transforms/Utils/LoopUtils.cpp
  mlir/unittests/CMakeLists.txt
  mlir/unittests/Support/CMakeLists.txt
  mlir/unittests/Support/IndexedAccessorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78064.257145.patch
Type: text/x-patch
Size: 41548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200413/d419ab36/attachment-0001.bin>


More information about the llvm-commits mailing list