[all-commits] [llvm/llvm-project] 093493: [mlir] Enable specifying querying function in Valu...
Jacques Pienaar via All-commits
all-commits at lists.llvm.org
Tue Aug 10 11:45:03 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 093493032d19adf879528a7e407909b36bd6570f
https://github.com/llvm/llvm-project/commit/093493032d19adf879528a7e407909b36bd6570f
Author: Jacques Pienaar <jpienaar at google.com>
Date: 2021-08-10 (Tue, 10 Aug 2021)
Changed paths:
M mlir/include/mlir/Interfaces/InferTypeOpInterface.h
M mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
M mlir/lib/Dialect/Tosa/Transforms/TosaInferShapes.cpp
M mlir/lib/Interfaces/InferTypeOpInterface.cpp
M mlir/unittests/Interfaces/CMakeLists.txt
A mlir/unittests/Interfaces/InferTypeOpInterfaceTest.cpp
Log Message:
-----------
[mlir] Enable specifying querying function in ValueShapeRange
This enables querying shapes/values as shapes without mutating the IR
directly (e.g., towards enabling doing inference in analysis &
application steps, inferring function shape with constant from callsite,
...). Add a new ShapeAdaptor that abstracts over whether shape is from
Type or ShapedTypeComponents or DenseIntElementsAttribute. This adds new
accessors to ValueShapeRange to get Shape and value as shape, but
doesn't restrict or remove the previous way of accessing Type via the
Value for now, that does mean a less refined shape could be accidentally
queried and will be restricted in follow up.
Currently restricted Value query to what can be represented as Shape. So
only supports cases where constant subgraph evaluation's output is a
shape. I had considered making it more general, but without TBD extern
attribute concept or some such a user cannot today uniformly avoid
overhead.
Update TOSA ops and also the shape inference pass.
Differential Revision: https://reviews.llvm.org/D107768
More information about the All-commits
mailing list