Implement lowering of quant.dcast to the fxpmathops and standard dialect.
authorStella Laurenzo <laurenzo@google.com>
Tue, 23 Apr 2019 00:35:38 +0000 (17:35 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Wed, 24 Apr 2019 05:02:25 +0000 (22:02 -0700)
commit8189e6ef908e35d90bee4d13972ce9bb6c8d8966
tree8ea85585d7db9f3c927652476165d746d231e15d
parent5c757087c741b5f1299a23f5dc3f1bcb7d46f8fa
Implement lowering of quant.dcast to the fxpmathops and standard dialect.

    Note that I broke this out as a separate pass because intermediate transformations often produce qcast/dcast ops that are integral to the transformation, and it is typical to want to lower any remaining, unmatched casts at the end of quantization. If this flexibility ends up not being needed, they can be collapsed into the same pass. This is included in the same cpp file because all of the math ops will need to defer to emitting quantize/dequantize logic for cases that they cannot be fully lowered to fixed-point math.

    Also, the new convertistof op needs to be evaluated for inclusion in StandardOps.

--

PiperOrigin-RevId: 244768679
mlir/include/mlir/FxpMathOps/FxpMathOps.td
mlir/include/mlir/FxpMathOps/Passes.h
mlir/include/mlir/Quantization/QuantTypes.h
mlir/lib/FxpMathOps/Transforms/LowerUniformRealMath.cpp
mlir/lib/FxpMathOps/Transforms/UniformKernelUtils.h
mlir/test/FxpMathOps/lower-uniform-casts.mlir [new file with mode: 0644]