llvm-project/llvm/lib/Transforms/Utils
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
..
AMDGPUEmitPrintf.cpp [AMDGPU] replace hostcall module flag with function attribute 2022-02-11 22:51:56 +05:30
ASanStackFrameLayout.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
AddDiscriminators.cpp
AssumeBundleBuilder.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
BasicBlockUtils.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
BreakCriticalEdges.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
BuildLibCalls.cpp [BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls. 2022-04-19 21:22:07 +02:00
BypassSlowDivision.cpp
CMakeLists.txt [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
CallGraphUpdater.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
CallPromotionUtils.cpp [WPD] Extend checking mode to support fallback to indirect call 2022-03-14 10:16:28 -07:00
CanonicalizeAliases.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
CanonicalizeFreezeInLoops.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
CloneFunction.cpp Implement inlining of strictfp functions 2022-03-31 19:15:52 +07:00
CloneModule.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
CodeExtractor.cpp [OpenMPIRBuilder] Allocate temporary at the correct block in a nested parallel 2022-03-06 18:34:25 -05:00
CodeLayout.cpp speeding up ext-tsp for huge instances 2022-03-02 07:17:48 -08:00
CodeMoverUtils.cpp [Transforms] Use make_early_inc_range (NFC) 2021-11-02 18:13:23 -07:00
CtorUtils.cpp [GlobalOpt] Handle undef global_ctors gracefully 2022-03-10 16:02:12 +01:00
Debugify.cpp [Utils] stripDebugifyMetadata - use cast<> instead of dyn_cast_or_null<> to avoid dereference of nullptr 2022-03-25 10:25:04 +00:00
DemoteRegToStack.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
EntryExitInstrumenter.cpp [NPM] Added -print-pipeline-passes print params for a few passes. 2021-09-15 08:34:04 +02:00
EscapeEnumerator.cpp
Evaluator.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
FixIrreducible.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
FlattenCFG.cpp [Transforms] Use {DenseSet,SetVector,SmallPtrSet}::contains (NFC) 2021-10-31 07:57:32 -07:00
FunctionComparator.cpp [FunctionComparator] Use getAlign() instead of getAlignment() 2021-12-15 14:40:56 -08:00
FunctionImportUtils.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
GlobalStatus.cpp [GlobalStatus] Keep Visited set in isSafeToDestroyConstant() 2022-02-22 10:02:37 +01:00
GuardUtils.cpp [llvm][NFC] Inclusive language: Reword replace uses of sanity in llvm/lib/Transform comments and asserts 2021-11-23 13:22:55 -05:00
HelloWorld.cpp
InjectTLIMappings.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
InlineFunction.cpp Implement inlining of strictfp functions 2022-03-31 19:15:52 +07:00
InstructionNamer.cpp
IntegerDivision.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LCSSA.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LibCallsShrinkWrap.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
Local.cpp Remove duplicate code from wouldInstructionBeTriviallyDead 2022-04-02 16:04:39 +07:00
LoopPeel.cpp [LoopPeel] Add EXPENSIVE_CHECKS ifdef guard around domtree verify call 2022-03-02 09:56:20 -08:00
LoopRotationUtils.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LoopSimplify.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LoopUnroll.cpp [unroll] Strengthen verification of analysis updates under expensive asserts 2022-01-06 08:51:50 -08:00
LoopUnrollAndJam.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LoopUnrollRuntime.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LoopUtils.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LoopVersioning.cpp [PSE] Remove assumption that top level predicate is union from public interface [NFC*] 2022-02-10 16:14:52 -08:00
LowerAtomic.cpp Transforms: Fix code duplication between LowerAtomic and AtomicExpand 2022-04-08 19:06:36 -04:00
LowerGlobalDtors.cpp Reland "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO" 2022-03-23 18:36:55 -07:00
LowerInvoke.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
LowerMemIntrinsics.cpp Add support for atomic memory copy lowering 2022-04-08 10:41:31 +07:00
LowerSwitch.cpp LowerSwitch: Avoid inserting NewDefault block 2022-04-14 13:30:56 +08:00
MatrixUtils.cpp
Mem2Reg.cpp
MemoryOpRemark.cpp [NFC][OpaquePtr] Use GlobalValue::getValueType() more 2021-07-09 09:55:41 -07:00
MemoryTaggingSupport.cpp Cleanup includes: final pass 2022-03-29 09:00:21 +02:00
MetaRenamer.cpp Revert "Rename llvm::array_lengthof into llvm::size to match std::size from C++17" 2022-01-26 16:55:53 +01:00
MisExpect.cpp [misexpect] Re-implement MisExpect Diagnostics 2022-04-19 21:23:48 +00:00
ModuleUtils.cpp [OpenMP] Use new offloading binary when embedding offloading images 2022-04-15 20:35:26 -04:00
NameAnonGlobals.cpp Cleanup header dependencies in LLVMCore 2022-02-02 06:54:20 +01:00
PredicateInfo.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
PromoteMemoryToRegister.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
RelLookupTableConverter.cpp [RelLookupTableConverter] Avoid querying TTI for declarations 2022-03-16 10:39:28 +01:00
SCCPSolver.cpp [FuncSpec] Support function specialization across multiple arguments. 2022-03-28 12:01:53 +01:00
SSAUpdater.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
SSAUpdaterBulk.cpp [Transforms] Remove HasValueForBlock (NFC) 2021-07-30 08:56:49 -07:00
SampleProfileInference.cpp Fix linking error, undefined class static constants. 2022-03-09 10:01:38 -08:00
SampleProfileLoaderBaseUtil.cpp introducing some profi flags 2022-03-08 12:35:15 -08:00
SanitizerStats.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
ScalarEvolutionExpander.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
SimplifyCFG.cpp [SimplifyCFG] Try to fold switch with single result value and power-of-2 cases to mask+select 2022-04-15 00:10:00 +08:00
SimplifyIndVar.cpp Fix warnings about variables that are set but only used in debug mode 2022-04-06 10:01:46 +03:00
SimplifyLibCalls.cpp [BuildLibCalls] Introduce getOrInsertLibFunc() for use when building libcalls. 2022-04-19 21:22:07 +02:00
SizeOpts.cpp
SplitModule.cpp [IR] Refactor GlobalIFunc to inherit from GlobalObject, Remove GlobalIndirectSymbol 2021-10-20 10:29:47 -07:00
StripGCRelocates.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
StripNonLineTableDebugInfo.cpp
SymbolRewriter.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
UnifyFunctionExitNodes.cpp
UnifyLoopExits.cpp Cleanup includes: TransformsUtils 2022-03-01 21:00:07 +01:00
Utils.cpp Reland "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO" 2022-03-23 18:36:55 -07:00
VNCoercion.cpp Cleanup header dependencies in LLVMCore 2022-02-02 06:54:20 +01:00
ValueMapper.cpp [DebugInfo] ValueMapper impl for DIArgList respects IgnoreMissingLocals 2022-01-17 17:17:32 +00:00