r352054 - [CPU-Dispatch] Make pentium_iii_no_xmm_regs and pentium_iii alias.

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 24 07:28:58 PST 2019


Author: erichkeane
Date: Thu Jan 24 07:28:57 2019
New Revision: 352054

URL: http://llvm.org/viewvc/llvm-project?rev=352054&view=rev
Log:
[CPU-Dispatch] Make pentium_iii_no_xmm_regs and pentium_iii alias.

I discovered that in ICC (where this list comes from), that the two
pentium_iii versions were actually identical despite the two different
names (despite them implying a difference). Because of this, they ended
up having identical manglings, which obviously caused problems when used
together.

This patch makes pentium_iii_no_xmm_regs an alias for pentium_iii so
that it can still be used, but has the same meaning as ICC. However, we
still prohibit using the two together which is different (albeit better)
behavior.

Change-Id: I4f3c9a47e48490c81525c8a3d23ed4201921b288

Modified:
    cfe/trunk/include/clang/Basic/X86Target.def
    cfe/trunk/test/Sema/attr-cpuspecific.c

Modified: cfe/trunk/include/clang/Basic/X86Target.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/X86Target.def?rev=352054&r1=352053&r2=352054&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/X86Target.def (original)
+++ cfe/trunk/include/clang/Basic/X86Target.def Thu Jan 24 07:28:57 2019
@@ -300,7 +300,7 @@ CPU_SPECIFIC("pentium_pro", 'C', "+cmov"
 CPU_SPECIFIC("pentium_mmx", 'D', "+mmx")
 CPU_SPECIFIC("pentium_ii", 'E', "+cmov,+mmx")
 CPU_SPECIFIC("pentium_iii", 'H', "+cmov,+mmx,+sse")
-CPU_SPECIFIC("pentium_iii_no_xmm_regs", 'H',"+cmov,+sse")
+CPU_SPECIFIC_ALIAS("pentium_iii_no_xmm_regs", "pentium_iii")
 CPU_SPECIFIC("pentium_4", 'J', "+cmov,+mmx,+sse,+sse2")
 CPU_SPECIFIC("pentium_m", 'K', "+cmov,+mmx,+sse,+sse2")
 CPU_SPECIFIC("pentium_4_sse3", 'L', "+cmov,+mmx,+sse,+sse2,+sse3")

Modified: cfe/trunk/test/Sema/attr-cpuspecific.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-cpuspecific.c?rev=352054&r1=352053&r2=352054&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-cpuspecific.c (original)
+++ cfe/trunk/test/Sema/attr-cpuspecific.c Thu Jan 24 07:28:57 2019
@@ -112,3 +112,6 @@ int __attribute__((cpu_specific(pentium_
 int use3(void) {
   return called_invalid_value();
 }
+
+// expected-warning at +1 {{CPU list contains duplicate entries; attribute ignored}}
+int __attribute__((cpu_dispatch(pentium_iii, pentium_iii_no_xmm_regs))) dupe_p3(void);




More information about the cfe-commits mailing list