[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2023-06-27 Thread Freddy, Ye via Phabricator via cfe-commits
FreddyYe added inline comments. Herald added a subscriber: StephenFan. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2067 + // favor this processor. + TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName(); +} pengfei wrote: > erichkeane w

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-14 Thread Erich Keane via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. erichkeane marked an inline comment as done. Closed by commit rGdc152659b452: Have cpu-specific variants set 'tune-cpu' as an optimization hint (authored by erichkeane)

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei accepted this revision. pengfei added a comment. LGTM. Comment at: clang/lib/Basic/Targets/X86.cpp:1133 +#include "llvm/Support/X86TargetParser.def" +.Default(""); +} clang-format. Comment at: llvm/include/llvm/Support/X86TargetPa

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM, though I'm not qualified to review the CPU specific bits in the .def file. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.org/D121410 _

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane marked 4 inline comments as done. erichkeane added inline comments. Comment at: llvm/include/llvm/Support/X86TargetParser.def:236 +CPU_SPECIFIC("core_i7_sse4_2", "nehalem", 'P', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") +CPU_SPECIFIC("core_aes_pclm

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 414709. erichkeane added a comment. Update the `core_aes_pclmulqdq` to be `westmere` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.org/D121410 Files: clang/include/clang/Basic/TargetInfo.h clang/lib/Basic/Tar

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: llvm/include/llvm/Support/X86TargetParser.def:236 +CPU_SPECIFIC("core_i7_sse4_2", "nehalem", 'P', "+cmov,+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt") +CPU_SPECIFIC("core_aes_pclmulqdq", "icelake-client", 'Q', "+cmov,+mmx

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Andy Kaylor via Phabricator via cfe-commits
andrew.w.kaylor accepted this revision. andrew.w.kaylor added a comment. This revision is now accepted and ready to land. This looks good to me. Thanks for the patch! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.org/D121410

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 414699. erichkeane added a comment. Corrected the last few processor names thanks to @andrew.w.kaylor and @pengfei CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.org/D121410 Files: clang/include/clang/Basic/Tar

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: llvm/include/llvm/Support/X86TargetParser.def:230 +CPU_SPECIFIC("pentium_m", "pentium-m", 'K', "+cmov,+mmx,+sse,+sse2") +CPU_SPECIFIC("pentium_4_sse3", "", 'L', "+cmov,+mmx,+sse,+sse2,+sse3") +CPU_SPECIFIC("core_2_duo_ssse3", "", 'M',

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 414650. erichkeane added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. add a 'translation' feature to the x86 target so that we can get the 'tune cpu' name from the list. Note that there are 9 with blanks that I was una

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Thanks all! I'll do some work on populating a list of 'converted names', but I'll definitely need @pengfei and @andrew.w.kaylor help checking the list/filling in what I miss. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.or

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a reviewer: arsenm. aaron.ballman added a subscriber: arsenm. aaron.ballman added a comment. Herald added a subscriber: wdng. Adding @arsenm because of this bit: > Note that the 'valid' list of processors for x86 is in > llvm/include/llvm/Support/X86TargetParser.def. At the m

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-11 Thread Phoebe Wang via Phabricator via cfe-commits
pengfei added a comment. Typos in `wiht different feature lists` and `In the even that`. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2067 + // favor this processor. + TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName(); +} erichkean

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-10 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2067 + // favor this processor. + TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName(); +} andrew.w.kaylor wrote: > Unfortunately, I don't think it's this ea

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-10 Thread Andy Kaylor via Phabricator via cfe-commits
andrew.w.kaylor added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2067 + // favor this processor. + TuneCPU = SD->getCPUName(GD.getMultiVersionIndex())->getName(); +} Unfortunately, I don't think it's this easy. The list of name

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-10 Thread Andy Kaylor via Phabricator via cfe-commits
andrew.w.kaylor added a comment. This example illustrates the problem this patch intends to fix: https://godbolt.org/z/j445sxPMc For Intel microarchitectures before Skylake, the LLVM cost model says that vector fsqrt is slow, so if fast-math is enabled, we'll use an approximation rather than t

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-10 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. @aaron.ballman : if you can add other reviewers or subscribers (particularly those from "VendorA") it would be greatly appreciated! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121410/new/ https://reviews.llvm.org/D121410 __

[PATCH] D121410: Have cpu-specific variants set 'tune-cpu' as an optimization hint

2022-03-10 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. erichkeane added a reviewer: aaron.ballman. Herald added a subscriber: pengfei. Herald added a project: All. erichkeane requested review of this revision. Due to various implementation constraints, despite the programmer choosing a 'processor' cpu_dispatch/cpu_spe