txfm: Work around VS2017 15.6 pgo bug.

Disable optimization of fdct16_avx2 when compiling under
Microsoft Visual Studio for IX86. We've had problems with
internal compiler errors on this function under profile-guided
optimization with the 15.5 and 15.6 releases.

The pragma can be removed for version-conditioned once
Microsoft addresses the issue.

https://developercommunity.visualstudio.com/content/problem/169932/internal-compiler-errors-on-vs-155-64-bit-involvin.html

Signed-off-by: Ralph Giles <giles@mozilla.com>

Change-Id: I9f4edaeb7dc65552cf275330c8377474130a73af
diff --git a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
index 333bad7..5d37ce7 100644
--- a/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
+++ b/av1/encoder/x86/hybrid_fwd_txfm_avx2.c
@@ -171,6 +171,11 @@
   in[15] = _mm256_srai_epi16(in[15], 2);
 }
 
+// Work around bugs in Visual Studio 2017 15.6 profile-guided optimization.
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_IX86)
+#pragma optimize("g", off)
+#endif
+
 static void fdct16_avx2(__m256i *in) {
   // sequence: cospi_L_H = pairs(L, H) and L first
   const __m256i cospi_p16_m16 = pair256_set_epi16(cospi_16_64, -cospi_16_64);
@@ -360,6 +365,11 @@
   in[3] = butter_fly(&x0, &x1, &cospi_m26_p06);
 }
 
+// Work around bugs in Visual Studio 2017 15.6 profile-guided optimization.
+#if defined(_MSC_VER) && !defined(__clang__) && defined(_M_IX86)
+#pragma optimize("", on)
+#endif
+
 void fadst16_avx2(__m256i *in) {
   const __m256i cospi_p01_p31 = pair256_set_epi16(cospi_1_64, cospi_31_64);
   const __m256i cospi_p31_m01 = pair256_set_epi16(cospi_31_64, -cospi_1_64);