Used the cephes numerical approximation for math.atan. This is a
significant accuracy improvement over the previous taylor series
approximation.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp | ||
---|---|---|
447 | We almost need polyeval :-) |
Comment Actions
Seems this patch caused build failure on x64 windows.
[6792/9410] Building CXX object tools\mlir\lib\Dialect\Math\Transforms\CMakeFiles\obj.MLIRMathTransforms.dir\PolynomialApproximation.cpp.obj FAILED: tools/mlir/lib/Dialect/Math/Transforms/CMakeFiles/obj.MLIRMathTransforms.dir/PolynomialApproximation.cpp.obj sccache C:\BuildTools\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe /nologo /TP -DBUILD_EXAMPLES -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=1 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_LIBCPP_ENABLE_ASSERTIONS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\mlir\lib\Dialect\Math\Transforms -IC:\ws\w3\llvm-project\premerge-checks\mlir\lib\Dialect\Math\Transforms -Iinclude -IC:\ws\w3\llvm-project\premerge-checks\llvm\include -IC:\ws\w3\llvm-project\premerge-checks\mlir\include -Itools\mlir\include /DWIN32 /D_WINDOWS /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw /MD /O2 /Ob2 /EHs-c- /GR- -UNDEBUG -std:c++17 /showIncludes /Fotools\mlir\lib\Dialect\Math\Transforms\CMakeFiles\obj.MLIRMathTransforms.dir\PolynomialApproximation.cpp.obj /Fdtools\mlir\lib\Dialect\Math\Transforms\CMakeFiles\obj.MLIRMathTransforms.dir\ /FS -c C:\ws\w3\llvm-project\premerge-checks\mlir\lib\Dialect\Math\Transforms\PolynomialApproximation.cpp C:\ws\w3\llvm-project\premerge-checks\mlir\lib\Dialect\Math\Transforms\PolynomialApproximation.cpp(444): error C2065: 'M_PI_4': undeclared identifier C:\ws\w3\llvm-project\premerge-checks\mlir\lib\Dialect\Math\Transforms\PolynomialApproximation.cpp(448): error C2065: 'M_PI_2': undeclared identifier
Comment Actions
Seems like a define needed for MSVC
https://learn.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-170
We almost need polyeval :-)