llvm/clang/lib/Frontend
Paul Kirth bac6cd5bf8 [misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its
original checking methodology only using MD_prof branch_weights
metadata.

New checks rely on 2 invariants:

1) For frontend instrumentation, MD_prof branch_weights will always be
   populated before llvm.expect intrinsics are lowered.

2) for IR and sample profiling, llvm.expect intrinsics will always be
   lowered before branch_weights are populated from the IR profiles.

These invariants allow the checking to assume how the existing branch
weights are populated depending on the profiling method used, and emit
the correct diagnostics. If these invariants are ever invalidated, the
MisExpect related checks would need to be updated, potentially by
re-introducing MD_misexpect metadata, and ensuring it always will be
transformed the same way as branch_weights in other optimization passes.

Frontend based profiling is now enabled without using LLVM Args, by
introducing a new CodeGen option, and checking if the -Wmisexpect flag
has been passed on the command line.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D115907
2022-04-19 21:23:48 +00:00
..
Rewrite [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
ASTConsumers.cpp [clang] Fix JSON AST output when a filter is used 2021-10-10 07:46:17 +05:30
ASTMerge.cpp
ASTUnit.cpp [clang] Fix bugprone argument comments (NFC) 2022-01-09 00:19:49 -08:00
ChainedDiagnosticConsumer.cpp
ChainedIncludesSource.cpp
CMakeLists.txt [clang][extract-api] Add global record support 2022-03-16 15:13:55 -07:00
CompilerInstance.cpp [clang] NFCI: Use DirectoryEntryRef in collectIncludePCH 2022-04-15 15:16:17 +02:00
CompilerInvocation.cpp [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
CreateInvocationFromCommandLine.cpp
DependencyFile.cpp [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
DependencyGraph.cpp [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
DiagnosticRenderer.cpp
FrontendAction.cpp [C++20][Modules][HU 4/5] Handle pre-processed header units. 2022-03-27 09:38:06 +01:00
FrontendActions.cpp Add HLSL Language Option and Preprocessor 2022-03-28 16:16:17 -05:00
FrontendOptions.cpp
HeaderIncludeGen.cpp [clang] Inclusive language: change instances of blacklist/whitelist to allowlist/ignorelist 2021-11-12 15:46:16 +00:00
InitPreprocessor.cpp NFC. Fixing rebase error 2022-03-29 13:19:06 -05:00
InterfaceStubFunctionsConsumer.cpp
LayoutOverrideSource.cpp [Driver, Frontend] Use StringRef::contains (NFC) 2021-10-19 08:54:02 -07:00
LogDiagnosticPrinter.cpp Remove a few effectively-unused FileEntry APIs. NFC 2022-04-07 16:45:47 +02:00
ModuleDependencyCollector.cpp [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
MultiplexConsumer.cpp [Clang] Override method ModuleImportRead in MultiplexASTDeserializationListener 2022-04-11 08:38:37 -04:00
PrecompiledPreamble.cpp [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
PrintPreprocessedOutput.cpp [clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective() 2022-04-14 10:46:12 +02:00
SerializedDiagnosticPrinter.cpp [clang] Remove redundant member initialization (NFC) 2022-01-02 10:20:23 -08:00
SerializedDiagnosticReader.cpp
TestModuleFileExtension.cpp [NFC][clang] Return underlying strings directly instead of OS.str() 2021-12-09 16:05:46 -08:00
TestModuleFileExtension.h
TextDiagnostic.cpp Remove a few effectively-unused FileEntry APIs. NFC 2022-04-07 16:45:47 +02:00
TextDiagnosticBuffer.cpp
TextDiagnosticPrinter.cpp
VerifyDiagnosticConsumer.cpp [clang][lex] NFC: Simplify calls to LookupFile 2022-01-18 16:02:18 +01:00