llvm-project/clang/lib/Basic
Erich Keane dc152659b4 Have cpu-specific variants set 'tune-cpu' as an optimization hint
Due to various implementation constraints, despite the programmer
choosing a 'processor' cpu_dispatch/cpu_specific needs to use the
'feature' list of a processor to identify it. This results in the
identified processor in source-code not being propogated to the
optimizer, and thus, not able to be tuned for.

This patch changes to use the actual cpu as written for tune-cpu so that
opt can make decisions based on the cpu-as-spelled, which should better
match the behavior expected by the programmer.

Note that the 'valid' list of processors for x86 is in
llvm/include/llvm/Support/X86TargetParser.def. At the moment, this list
contains only Intel processors, but other vendors may wish to add their
own entries as 'alias'es (or with different feature lists!).

If this is not done, there is two potential performance issues with the
patch, but I believe them to be worth it in light of the improvements to
behavior and performance.

1- In the event that the user spelled "ProcessorB", but we only have the
features available to test for "ProcessorA" (where A is B minus
features),
AND there is an optimization opportunity for "B" that negatively affects
"A", the optimizer will likely choose to do so.

2- In the event that the user spelled VendorI's processor, and the
feature
list allows it to run on VendorA's processor of similar features, AND
there
is an optimization opportunity for VendorIs that negatively affects
"A"s,
the optimizer will likely choose to do so. This can be fixed by adding
an
alias to X86TargetParser.def.

Differential Revision: https://reviews.llvm.org/D121410
2022-03-14 06:14:30 -07:00
..
Targets Have cpu-specific variants set 'tune-cpu' as an optimization hint 2022-03-14 06:14:30 -07:00
Attributes.cpp [OpenMP] Support OpenMP 5.1 attributes 2021-07-12 06:51:19 -04:00
Builtins.cpp [OpenCL] Add support of language builtins for OpenCL C 3.0 2022-02-11 15:53:44 +03:00
CLWarnings.cpp Reland "[clang-cl] Accept `#pragma warning(disable : N)` for some N" 2021-09-30 15:03:23 -04:00
CMakeLists.txt Reland "[clang-cl] Accept `#pragma warning(disable : N)` for some N" 2021-09-30 15:03:23 -04:00
CharInfo.cpp
CodeGenOptions.cpp [NFC] Remove duplicate isNoBuiltinFunc method 2021-03-10 09:18:55 +01:00
Cuda.cpp [AMDGPU] Add gfx1036 target 2022-03-02 23:26:38 +00:00
DarwinSDKInfo.cpp [Clang] Extract availability mapping from VersionMap for watchOS/tvOS 2022-01-05 17:00:03 -08:00
Diagnostic.cpp [Diagnostics] Don't drop a statically set NoWarningAsError flag during option processing 2022-01-10 16:38:01 -08:00
DiagnosticIDs.cpp Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
DiagnosticOptions.cpp
ExpressionTraits.cpp [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits... 2020-06-11 14:35:52 +01:00
FileEntry.cpp Basic: Add native support for stdin to SourceManager and FileManager 2020-12-23 15:18:50 -08:00
FileManager.cpp Fix a use-after-scope from 9902362701 2021-10-29 16:25:13 -07:00
FileSystemStatCache.cpp
IdentifierTable.cpp [CodeCompletion][clangd] Clean __uglified parameter names in completion & hover 2022-01-26 15:51:17 +01:00
LangOptions.cpp [OpenCL] Defines helper function for kernel language compatible OpenCL version 2021-08-31 10:08:38 +01:00
LangStandards.cpp
Module.cpp [clang][modules] Report module maps affecting `no_undeclared_includes` modules 2022-03-07 10:47:46 +01:00
NoSanitizeList.cpp [clang][patch] Inclusive language, modify filename SanitizerBlacklist.h to NoSanitizeList.h 2021-02-22 15:11:37 -05:00
ObjCRuntime.cpp
OpenCLOptions.cpp [OpenCL] Turn global vector into static array. NFCI. 2022-03-05 19:16:28 +01:00
OpenMPKinds.cpp Enable inoutset dependency-type in depend clause. 2022-02-08 08:35:36 -05:00
OperatorPrecedence.cpp
ProfileList.cpp [clang] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine) 2021-10-06 11:43:19 +01:00
SanitizerSpecialCaseList.cpp
Sanitizers.cpp [clang-cl][sanitizer] Add -fsanitize-address-use-after-return to clang. 2021-06-11 12:07:35 -07:00
SourceLocation.cpp [NFC][clang] Return underlying strings directly instead of OS.str() 2021-12-09 16:05:46 -08:00
SourceManager.cpp [clang][NFC] Inclusive terms: replace some uses of sanity in clang 2021-11-19 14:58:35 -05:00
Stack.cpp
TargetID.cpp [Basic] Drop unnecessary const from return types (NFC) 2021-12-29 08:55:37 -08:00
TargetInfo.cpp [X86][MS] Add 80bit long double support for Windows 2022-02-14 13:32:29 +08:00
Targets.cpp [clang][macho] add clang frontend support for emitting macho files with two build version load commands 2022-02-02 08:30:39 -08:00
Targets.h
TokenKinds.cpp [Pseudo] Token/TokenStream, PP directive parser. 2022-02-23 17:52:02 +01:00
TypeTraits.cpp [clang][NFC] Generate the {Type,ArrayType,UnaryExprOrType,Expression}Traits... 2020-06-11 14:35:52 +01:00
Version.cpp [NFC][clang] Return underlying strings directly instead of OS.str() 2021-12-09 16:05:46 -08:00
Warnings.cpp [Sema] Special case -Werror-implicit-function-declaration and reject other -Werror- 2020-11-05 10:25:30 -08:00
XRayInstr.cpp [clang][cli] Generate and round-trip CodeGen options 2021-02-09 11:43:38 +01:00
XRayLists.cpp