[compiler-rt] [compiler-rt] Restore unsigned value in struct, use enum only in function (PR #165048)
    Mikołaj Piróg via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Oct 26 04:06:11 PDT 2025
    
    
  
================
@@ -823,14 +847,19 @@ static const char *getAMDProcessorTypeAndSubtype(
       // Models 60h-6Fh (Krackan1).
       // Models 70h-77h (Sarlak).
       CPU = "znver5";
-      *Subtype = AMDFAM1AH_ZNVER5;
+      Subtype = AMDFAM1AH_ZNVER5;
       break; //  "znver5"
     }
     break;
   default:
     break; // Unknown AMD CPU.
   }
 
+  if (Type != CPU_TYPE_MAX)
+    __cpu_model.__cpu_type = Type;
+  if (Subtype != CPU_SUBTYPE_MAX)
+    __cpu_model.__cpu_subtype = Subtype;
----------------
mikolaj-pirog wrote:
I don't see it, why have early return? It's possible for a case to set both type and subtype (e.g. DMR)
https://github.com/llvm/llvm-project/pull/165048
    
    
More information about the llvm-commits
mailing list