[PATCH] D151696: [x86] Remove CPU_SPECIFIC* MACROs and add getManglingForCPU

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 15 06:21:01 PDT 2023


RKSimon added inline comments.


================
Comment at: llvm/lib/TargetParser/X86TargetParser.cpp:15
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/StringExtras.h"
 #include <numeric>
----------------
(clang-format) - include order


================
Comment at: llvm/lib/TargetParser/X86TargetParser.cpp:314
+ // Empty processor. Include X87 and CMPXCHG8 for backwards compatibility.
+  { {""}, CK_None, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false },
+  { {"generic"}, CK_None, ~0U, FeaturesPentiumMMX & ~FeaturesPentiumMMX, 'A', true },
----------------
Would it be better to move all of this into X86TargetParser.def ?


================
Comment at: llvm/lib/TargetParser/X86TargetParser.cpp:315
+  { {""}, CK_None, ~0U, FeatureX87 | FeatureCMPXCHG8B, '\0', false },
+  { {"generic"}, CK_None, ~0U, FeaturesPentiumMMX & ~FeaturesPentiumMMX, 'A', true },
   // i386-generation processors.
----------------
FeaturesPentiumMMX & ~FeaturesPentiumMMX ?


================
Comment at: llvm/test/CodeGen/X86/cpus-intel.ll:26
 ; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=emeraldrapids 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
+; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=generic 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
+; RUN: llc < %s -o /dev/null -mtriple=i686-unknown-unknown -mcpu=pentium_ii 2>&1 | FileCheck %s --check-prefix=CHECK-NO-ERROR --allow-empty
----------------
Keeping all the aliased cpus variants RUN together will make maintenance easier (e.g. pentium_mmx)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151696/new/

https://reviews.llvm.org/D151696



More information about the cfe-commits mailing list