[mlir] Add Tosa dialect const folder for tosa.const.
authorStella Laurenzo <stellaraccident@gmail.com>
Tue, 24 Nov 2020 16:58:26 +0000 (16:58 +0000)
committerStella Laurenzo <stellaraccident@gmail.com>
Tue, 24 Nov 2020 17:33:00 +0000 (17:33 +0000)
commitdb9713cd776ac5963efc502a5db6b315335aad9a
tree7cb8ee044a5159c4eae710479c59c2f8bc0b5b60
parent0ec73a61cca6cddf3255338c24fb5398fe45b74d
[mlir] Add Tosa dialect const folder for tosa.const.

* Was missed in the initial submission and is required for a ConstantLike op.
* Also adds a materializeConstant hook to preserve it.
* Tightens up the argument constraint on tosa.const to match what is actually legal.

Differential Revision: https://reviews.llvm.org/D92040
mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td
mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
mlir/test/Dialect/Tosa/constant_folding.mlir [new file with mode: 0644]