JuliaLang/julia — pull request #7155 by ArchRobison (2014-06-06 15:16:13+00:00)
Title: Enable AVX for  Intel 4th-Generation Core processor ("Haswell") .

This patch enables AVX on "Haswell" processors. Previously, Julia was treating such shiny new processors as 2004 vintage processors, notably foregoing AVX. The patch also fixes a problem for some low-end "Penryn" processors that lack SSE 4.1. The patch is large, but is all copied line-by-line from LLVM 3.4, so I don't expect any problems.

The root problem was that the CPU identification logic in LLVM 3.3 did not know about the Haswell model numbers, and so was treating such machines as generic 64-bit x86.

An alternative that I considered was to add only the new switch cases and have them return ```"core-avx-i"``` instead of ```"core-avx2"``` But it felt safer to just copy existing code from LLVM 3.4. Currently, Julia turns off AVX2 support explicitly if not using MCJIT, because of a known bug, so the patch effectively does not enable AVX2.

This PR fixes the LLVM 3.3 problem mentioned in #7097, but not the LLVM trunk problem.