[PATCH] D85384: [X86] Add basic support for -mtune command line option in clang

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 5 17:45:54 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: echristo, RKSimon, spatel, efriedma.
Herald added a subscriber: dang.
craig.topper requested review of this revision.

Building on the backend support from D85165 <https://reviews.llvm.org/D85165>. This parses the command line option in the driver, passes it on to CC1 and adds a function attribute.

Still need to support tune on the target attribute.
Need to use "generic" as the tuning by default. But need to change generic in the backend first.
Need to set tune if march is specified and mtune isn't.
May need to disable getHostCPUName's ability to guess CPU name from features when it doesn't have a family/model match for mtune=native. That's what gcc appears to do.


https://reviews.llvm.org/D85384

Files:
  clang/include/clang/Basic/TargetOptions.h
  clang/include/clang/Driver/Options.td
  clang/lib/Basic/Targets.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/tune-cpu.c
  clang/test/Driver/x86-mtune.c
  clang/test/Misc/target-invalid-cpu-note.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85384.283456.patch
Type: text/x-patch
Size: 8305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200806/796ac443/attachment.bin>


More information about the llvm-commits mailing list