[PATCH] D73593: [mlir] [VectorOps] consolidate all vector utilities to one header/cc file

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 15:02:57 PST 2020


dcaballe requested changes to this revision.
dcaballe added inline comments.
This revision now requires changes to proceed.


================
Comment at: mlir/include/mlir/Dialect/VectorOps/VectorUtils.h:1
-//===- Utils.h - VectorOps Utils ----------------------------*- C++ -*-=======//
+//===- Utils.h - VectorOps Utilities ------------------------*- C++ -*-=======//
 //
----------------
Utils.h -> VectorUtils.h?


================
Comment at: mlir/include/mlir/Dialect/VectorOps/VectorUtils.h:37
+/// de-linearized index.
+SmallVector<int64_t, 4> delinearize(ArrayRef<int64_t> sliceStrides,
+                                    int64_t linearIndex);
----------------
All these utilities returning `SmallVector` should be turned into `void utility_name(..., SmallVectorImpl<element_type>& output_name)` so that they can accept SmallVectors of arbitrary static sizes.


================
Comment at: mlir/lib/Dialect/VectorOps/VectorTransforms.cpp:115
+  assert(static_cast<int64_t>(sizes.size()) == vectorType.getRank());
+  assert(static_cast<int64_t>(strides.size()) == vectorType.getRank());
 
----------------
just curious... why is this static_cast needed?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73593





More information about the llvm-commits mailing list