diff --git a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp --- a/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp +++ b/mlir/lib/Dialect/Math/Transforms/PolynomialApproximation.cpp @@ -441,6 +441,9 @@ ans0 = builder.create(ans0, x, x); // Correct for the input mapping's angles: +#ifdef _WIN32 +#define _USE_MATH_DEFINES +#endif Value mpi4 = bcast(f32Cst(builder, M_PI_4)); Value ans2 = builder.create(mpi4, ans0); Value ans = builder.create(cmp2, ans2, ans0);