Avoid infinity arithmetics when computing exp approximations
authorAhmed Taei <ataei@google.com>
Wed, 20 Oct 2021 00:56:55 +0000 (17:56 -0700)
committerAhmed Taei <ataei@google.com>
Thu, 21 Oct 2021 17:09:18 +0000 (10:09 -0700)
commit21f9e4a1ed91adc9aac0ba209ad4c264cad3b6ff
tree3ca008f8c0cf432a5250e002f60c166695ed3cb7
parent92a6dd6e50c8055a4db88f42966e48a915b81c76
Avoid infinity arithmetics when computing exp approximations

Otherwise this can result a poison value on some platforms see https://bugs.llvm.org/show_bug.cgi?id=51204

Reviewed By: ezhulenev

Differential Revision: https://reviews.llvm.org/D112115
mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp
mlir/test/Dialect/Math/polynomial-approximation.mlir
mlir/test/mlir-cpu-runner/math_polynomial_approx.mlir