nir: Temporarily disable optimizations for MSVC ARM64

There's currently an MSVC optimizer bug which causes a stack overflow
in the compiler if it attempts to optimize fsat.

Acked-by: Rob Clark <robdclark@chromium.org>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9700>
This commit is contained in:
Jesse Natalie
2021-03-18 18:46:09 -07:00
committed by Marge Bot
parent 3e68e7f90d
commit 55d153b9f5

View File

@@ -459,6 +459,11 @@ struct ${type}${width}_vec {
</%def> </%def>
% for name, op in sorted(opcodes.items()): % for name, op in sorted(opcodes.items()):
% if op.name == "fsat":
#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
#pragma optimize("", off) /* Temporary work-around for MSVC compiler bug, present in VS2019 16.9.2 */
#endif
% endif
static void static void
evaluate_${name}(nir_const_value *_dst_val, evaluate_${name}(nir_const_value *_dst_val,
UNUSED unsigned num_components, UNUSED unsigned num_components,
@@ -482,6 +487,11 @@ evaluate_${name}(nir_const_value *_dst_val,
${evaluate_op(op, 0, execution_mode)} ${evaluate_op(op, 0, execution_mode)}
% endif % endif
} }
% if op.name == "fsat":
#if defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM64EC))
#pragma optimize("", on) /* Temporary work-around for MSVC compiler bug, present in VS2019 16.9.2 */
#endif
% endif
% endfor % endfor
void void