[llvm-dev] bad identification of the CPU pentium dual core ( penryn instead of core2 )

Barto via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 21 12:23:40 PDT 2015


lvm 3.7.0 treats pentium dual core ( cpu family 6 model 23 ) as "penryn"
cpu, which triggers a serious bug :

- crashs in openGL programs when llvm is used by mesa package, llvm will
produces binary code with SSE4 instructions, which is not compatible
with pentium dual core, because this CPU doesn't support SSE4
instructions ( bad cpu opcodes ),

with llvm 3.6.2 this bug doesn't occur because pentium dual core was
treated as "core2" cpu, which is the good behaviour,

the llvm git commit who has introduced this bug is :

cd83d5b5071f072882ad06cc4b904b2d27d1e54a

https://github.com/llvm-mirror/llvm/commit/cd83d5b5071f072882ad06cc4b904b2d27d1e54a

this faulty commit has deleted a crucial test about SSE4 for CPU family
6 model 23 :

return HasSSE41 ? "penryn" : "core2";

the solution is simply to re-add this test for CPU family 6 model 23,
here is the patch :

--- a/lib/Support/Host.cpp    2015-10-14 07:13:52.381374679 +0200
+++ b/lib/Support/Host.cpp   2015-10-14 07:13:28.224708323 +0200
@@ -332,6 +332,8 @@
                // 17h. All processors are manufactured using the 45 nm process.
                //
                // 45nm: Penryn , Wolfdale, Yorkfield (XE)
+        // Not all Penryn processors support SSE 4.1 (such as the Pentium brand)
+        return HasSSE41 ? "penryn" : "core2";          
       case 29: // Intel Xeon processor MP. All processors are manufactured using
                // the 45 nm process.
         return "penryn";




More information about the llvm-dev mailing list