Implement lowering of element-wise fixed point add and mul to the standard dialect.
authorStella Laurenzo <laurenzo@google.com>
Fri, 19 Apr 2019 00:06:05 +0000 (17:06 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:00:53 +0000 (22:00 -0700)
commite8d551e2bda03928307460cb0ff151b9b5b312a0
tree3590c2b80ea82e00d6c0e20bb5cbc60eae2b9040
parent7977e62b96b9cdf32b1884fa238bfcea2a146f2b
Implement lowering of element-wise fixed point add and mul to the standard dialect.

    This also does the following:
      - Removes the poc POT add implementation in favor of a version that does not rescale.
      - Adds a handful of FxpMathOps which are needed (these are for comment and we may want to move them to the StandardOps dialect).
      - Adds a canonicalizer to the StorageCastOp, which removes some cruft once conversions have been done.
      - Adds a couple of predicates to OpBase.

--

PiperOrigin-RevId: 244287706
mlir/include/mlir/FxpMathOps/FxpMathOps.td
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/Quantization/QuantOps.td
mlir/include/mlir/StandardOps/Ops.td
mlir/lib/FxpMathOps/Transforms/LowerUniformRealMath.cpp
mlir/lib/FxpMathOps/Transforms/UniformKernelUtils.h [new file with mode: 0644]
mlir/lib/Quantization/IR/QuantOps.cpp
mlir/test/FxpMathOps/lower-uniform-real-math-addew.mlir
mlir/test/FxpMathOps/lower-uniform-real-math-mulew.mlir [new file with mode: 0644]
mlir/test/Quantization/canonicalize.mlir [new file with mode: 0644]