Blob Blame History Raw
Skylake Pentium has the charming property of not supporting AVX, and
getHostCPUName will return 'x86-64' since it doesn't know about skl at
all in 3.6.x.  This confuses llvmpipe quite badly, as we'll emit SSE4.1
intrinsics but llvm will think they're not valid, and we'll cough and
die with a "Cannot select" message.

Fix this by treating Skylake (and Broadwell, which also isn't present
in 3.6) as if they were Haswell.  This isn't quite what upstream does,
but upstream has changed this API a bit and introduced a getHostCPUFeatures
to complement it, and while it looks like a much better approach it's
quite a bit more invasive.

diff -up llvm-3.6.2.src/lib/Support/Host.cpp.jx llvm-3.6.2.src/lib/Support/Host.cpp
--- llvm-3.6.2.src/lib/Support/Host.cpp.jx	2015-10-01 12:08:39.000000000 -0400
+++ llvm-3.6.2.src/lib/Support/Host.cpp	2015-10-13 10:51:03.736425351 -0400
@@ -362,6 +362,12 @@ StringRef sys::getHostCPUName() {
       case 63:
       case 69:
       case 70:
+      // Broadwell:
+      case 61:
+      case 71:
+      // Skylake:
+      case 78:
+      case 94:
         // Not all Haswell processors support AVX too (such as the Pentium
         // versions instead of the i7 versions).
         return HasAVX2 ? "core-avx2" : "corei7";