What is the /d2vzeroupper MSVC compiler optimization flag doing?

What is the /d2vzeroupper MSVC compiler optimization flag doing?

I was reading through this Compiler Options Quick Reference Guide
for Epyc CPUs from AMD: https://developer.amd.com/wordpress/media/2020/04/Compiler%20Options%20Quick%20Ref%20Guide%20for%20AMD%20EPYC%207xx2%20Series%20Processors.pdf

For MSVC, to "Optimize for 64-bit AMD processors", they recommend to enable /favor:AMD64 /d2vzeroupper.

What /favor:AMD64 is doing is clear, there is documentation about that in the MSVC docs. But I can’t seem to find /d2vzeroupper being mentioned anywhere in the internet at all, no documentation anywhere. What is it doing?

Source: Windows Questions C++

LEAVE A COMMENT