Add pattern that expands `math.roundeven` into `math.round` + arith
authorRamiro Leal-Cavazos <ramiroleal050@gmail.com>
Thu, 20 Apr 2023 19:35:57 +0000 (12:35 -0700)
committerJacques Pienaar <jpienaar@google.com>
Thu, 20 Apr 2023 19:48:12 +0000 (12:48 -0700)
commit8d2bae9abdc30e104bab00a4dd0f9d39f5bdda6e
treef1586e63b4bb95ca457ab5618533a6ce79786371
parent28114722baabb468732a9cc24784abafd6c47792
Add pattern that expands `math.roundeven` into `math.round` + arith

This commit adds a pattern that expands `math.roundeven` into
`math.round` + some ops from `arith`. This is needed to be able to run
`math.roundeven` in a vectorized manner.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D148285
mlir/include/mlir/Dialect/Math/Transforms/Passes.h
mlir/lib/Dialect/Math/Transforms/ExpandPatterns.cpp
mlir/test/Dialect/Math/expand-math.mlir
mlir/test/lib/Dialect/Math/TestExpandMath.cpp
mlir/test/mlir-cpu-runner/test-expand-math-approx.mlir