OSDN Git Service

[MLIR] Add `num_elements` to the shape dialect
authorFrederik Gossen <frgossen@google.com>
Thu, 28 May 2020 14:04:39 +0000 (14:04 +0000)
committerFrederik Gossen <frgossen@google.com>
Thu, 28 May 2020 14:05:58 +0000 (14:05 +0000)
commitfdaa391e3df3c3a555d933122b0ef85eaf5eb63c
tree3fbc056dd46e0366d36d4f64653e936fde0224b5
parentd6671ee90c1423eb18c6fab11819df850ae2200d
[MLIR] Add `num_elements` to the shape dialect

The operation `num_elements` determines the number of elements for a given
shape.
That is the product of its dimensions.

Differential Revision: https://reviews.llvm.org/D80281
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Dialect/Shape/canonicalize.mlir