llvm-project/llvm/lib
Paul Kirth 2add3fbd97 [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-03-28 23:30:04 +00:00
..
Analysis Recommit "[SLP] Fix lookahead operand reordering for splat loads." attempt 3, fixed assertion crash. 2022-03-23 18:32:17 -07:00
AsmParser Revert "Revert "[OpaquePtr][LLParser] Automatically detect opaque pointers in .ll files"" 2022-03-21 17:24:56 -07:00
BinaryFormat [CUDA] Add CUDA fatbinary magic 2022-03-14 20:08:31 -04:00
Bitcode [Bitcode] Check for live uses of llvm.cmdline/embedded.module 2022-03-23 15:39:39 +01:00
Bitstream [Bitstream] Remove pessimizing move 2022-02-16 08:23:02 +01:00
CodeGen [RISCV][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI. 2022-03-28 12:46:36 -07:00
DWARFLinker Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
DWP Cleanup LLVMObject headers 2022-02-10 21:13:44 +01:00
DebugInfo Apply clang-tidy fixes for readability-redundant-smartptr-get in GsymReader.cpp (NFC) 2022-03-28 09:18:30 -07:00
Debuginfod Fix buildbot failures from 7917b3c6. 2022-03-21 17:58:22 +00:00
Demangle ItaniumDemangler: Update BinaryExpr::match to match the ctor 2022-03-28 21:51:27 +00:00
ExecutionEngine Remove a top-level using-directive from EPCDebugObjectRegistrar.h 2022-03-28 15:14:20 +02:00
Extensions
FileCheck [FileCheck] Allow literal '['s before "[[var...]]" 2022-01-13 09:47:37 +00:00
Frontend [mlir][OpenMP][IRBuilder] Add support for nowait on single construct 2022-03-24 22:51:52 +05:30
FuzzMutate Revert "[FuzzMutate] Don't insert instructions after musttail call" 2022-03-16 17:29:27 +01:00
Fuzzer
IR [misexpect] Re-implement MisExpect Diagnostics 2022-03-28 23:30:04 +00:00
IRReader
InterfaceStub Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
LTO Apply clang-tidy fixes for readability-redundant-smartptr-get in SummaryBasedOptimizations.cpp (NFC) 2022-03-28 09:18:31 -07:00
LineEditor [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
Linker [PseudoProbe] Do not emit pseudo probes when module is not probed. 2022-03-25 12:59:53 -07:00
MC [MC] Fix llvm_unreachable when a STB_GNU_UNIQUE symbol needs a relocation 2022-03-28 13:40:48 -07:00
MCA [MCA] Removed unused variable. 2022-03-13 21:55:56 -07:00
ObjCopy Apply clang-tidy fixes for modernize-use-equals-default in ELFObject.cpp (NFC) 2022-03-28 09:18:25 -07:00
Object Apply clang-tidy fixes for readability-redundant-smartptr-get in TapiUniversal.cpp (NFC) 2022-03-28 09:18:36 -07:00
ObjectYAML [WebAssembly] Rename member in WasmYAML.h to avoid compiler warning 2022-03-14 09:09:43 -07:00
Option
Passes Reland "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO" 2022-03-23 18:36:55 -07:00
ProfileData Apply clang-tidy fixes for readability-redundant-smartptr-get in SampleProfReader.cpp (NFC) 2022-03-28 09:18:39 -07:00
Remarks Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
Support Add HLSL Language Option and Preprocessor 2022-03-28 16:16:17 -05:00
TableGen [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td 2022-03-15 00:18:03 -07:00
Target [RISCV][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI. 2022-03-28 12:46:36 -07:00
Testing Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
TextAPI Cleanup LLVMTextAPI headers 2022-01-26 14:21:25 +01:00
ToolDrivers
Transforms [misexpect] Re-implement MisExpect Diagnostics 2022-03-28 23:30:04 +00:00
WindowsDriver Cleanup includes: WindowsDriver & WindowsManifest 2022-03-10 17:19:06 +01:00
WindowsManifest Cleanup includes: WindowsDriver & WindowsManifest 2022-03-10 17:19:06 +01:00
XRay [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
CMakeLists.txt [llvm-objcopy][NFC] Move core implementation of llvm-objcopy into separate library. 2022-02-17 13:11:42 +03:00