llvm-project/llvm/lib/Analysis
Fangrui Song a996cc217c Remove unused #include "llvm/ADT/Optional.h" 2022-12-05 06:31:11 +00:00
..
models Reland "[MLGO] ML Regalloc Priority Advisor" 2022-09-30 16:27:26 -05:00
AliasAnalysis.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
AliasAnalysisEvaluator.cpp [AA] Do not track Must in ModRefInfo 2022-08-01 07:14:31 +02:00
AliasAnalysisSummary.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
AliasAnalysisSummary.h
AliasSetTracker.cpp [AST] Don't use WeakVH for unknown insts (NFCI) 2022-11-15 16:46:05 +01:00
Analysis.cpp [AST] Remove legacy AliasSetPrinter pass 2022-11-14 15:50:38 +01:00
AssumeBundleQueries.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
AssumptionCache.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
BasicAliasAnalysis.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
BlockFrequencyInfo.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
BlockFrequencyInfoImpl.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
BranchProbabilityInfo.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
CFG.cpp [CFG] Add const qualifier to isPotentiallyReachableFromMany() (NFC) 2022-10-18 10:06:07 +02:00
CFGPrinter.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
CFGSCCPrinter.cpp Ensure newlines at the end of files (NFC) 2022-10-22 09:29:40 -07:00
CFLAndersAliasAnalysis.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
CFLGraph.h [NFC] Removed call to getInstList() from range loops on BBs. 2022-11-29 17:33:10 -08:00
CFLSteensAliasAnalysis.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
CGSCCPassManager.cpp Remove unused #include "llvm/ADT/Optional.h" 2022-12-05 06:31:11 +00:00
CMakeLists.txt Port print-cfg-sccs to new pass manager 2022-10-18 08:47:08 -07:00
CallGraph.cpp [CallGraph] Port -print-callgraph-sccs to new pass manager 2022-10-11 14:43:16 -07:00
CallGraphSCCPass.cpp Use PassGate from LLVMContext if any otherwise global one 2022-11-25 15:13:04 +07:00
CallPrinter.cpp [CallPrinter] Port CallPrinter passes to new pass manager 2022-04-18 10:02:18 -07:00
CaptureTracking.cpp [CaptureTracking] Increase limit and use it for all visited uses. 2022-06-02 21:43:58 +01:00
CmpInstAnalysis.cpp [InstCombine][Analysis] Move getFCmpCode and getPredForFCmpCode to CmpInstAnalysis. NFC 2022-03-03 09:33:24 -08:00
CodeMetrics.cpp [CostModel] Replace getUserCost with getInstructionCost 2022-08-18 11:55:23 +01:00
ConstantFolding.cpp [IR] llvm::Optional => std::optional 2022-12-05 04:13:11 +00:00
ConstraintSystem.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
CostModel.cpp [NFC] Fix a few whitespace inconsistencies. 2022-10-20 14:52:25 +00:00
CycleAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
DDG.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
DDGPrinter.cpp Remove unneeded cl::ZeroOrMore for cl::opt/cl::list options 2022-06-05 00:31:44 -07:00
Delinearization.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
DemandedBits.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
DependenceAnalysis.cpp [DependenceAnalysis][PR56275] Normalize negative dependence analysis results 2022-08-03 19:59:00 -04:00
DependenceGraphBuilder.cpp [NFC] Remove unnecessary #includes 2022-02-04 21:22:41 -08:00
DevelopmentModeInlineAdvisor.cpp [mlgo][nfc] Make `LoggedFeatureSpec` an implementation detail 2022-11-30 15:57:58 -08:00
DivergenceAnalysis.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
DomPrinter.cpp [DomPrinter] Migrate -dot-dom to the new pass manager. 2022-05-16 15:07:16 -05:00
DomTreeUpdater.cpp [NFC] Replaced BB->getInstList().{erase(),pop_front(),pop_back()} with eraseFromParent(). 2022-11-23 22:47:46 -08:00
DominanceFrontier.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
EHPersonalities.cpp Revert "[Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 2" 2022-12-02 02:44:18 -08:00
FunctionPropertiesAnalysis.cpp [FunctionPropertiesAnalysis] Generalize support for unreachable 2022-06-21 08:18:01 -07:00
GlobalsModRef.cpp [AA] A global cannot escape through nocapture/nocallback call. 2022-11-28 12:50:31 -08:00
GuardUtils.cpp
HeatUtils.cpp [iwyu] Move <cmath> out of llvm/Support/MathExtras.h 2022-09-28 20:49:01 +02:00
IRSimilarityIdentifier.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
IVDescriptors.cpp [LV][IVDescriptors] Fix recurrence identity element for FMin and FMax reductions 2022-11-04 10:39:37 -04:00
IVUsers.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
ImportedFunctionsInliningStatistics.cpp [Inliner] Move cl::opt inside llvm:: 2022-11-24 20:31:13 -08:00
IndirectCallPromotionAnalysis.cpp Remove unneeded cl::ZeroOrMore for cl::opt options 2022-06-04 00:10:42 -07:00
InlineAdvisor.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:31:17 -08:00
InlineCost.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:31:17 -08:00
InlineOrder.cpp [ModuleInliner] Add MLPriority 2022-12-02 14:25:13 -08:00
InlineSizeEstimatorAnalysis.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
InstCount.cpp
InstructionPrecedenceTracking.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
InstructionSimplify.cpp Attributes: convert Optional to std::optional 2022-12-02 08:15:45 -06:00
Interval.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
IntervalPartition.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp [LazyCallGraph] Handle spurious ref edges when deleting a dead function 2022-09-22 15:01:15 -07:00
LazyValueInfo.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
LegacyDivergenceAnalysis.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
Lint.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
Loads.cpp [Analysis] `isSafeToLoadUnconditionally()`: `lifetime` intrinsics can be ignored 2022-11-17 20:48:27 +03:00
LoopAccessAnalysis.cpp Compress a few pairs using PointerIntPairs 2022-12-04 16:55:16 +01:00
LoopAnalysisManager.cpp [Analysis] Use std::optional in LoopAnalysisManager.cpp (NFC) 2022-11-25 10:28:54 -08:00
LoopCacheAnalysis.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
LoopInfo.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
LoopNestAnalysis.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
LoopPass.cpp Use PassGate from LLVMContext if any otherwise global one 2022-11-25 15:13:04 +07:00
LoopUnrollAnalyzer.cpp [NFC] format InstructionSimplify & lowerCaseFunctionNames 2022-06-09 16:10:08 +02:00
MLInlineAdvisor.cpp [MLGO][NFC] Use std::map instead of DenseMap to avoid use after free 2022-11-04 16:07:24 -07:00
MemDepPrinter.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MemDerefPrinter.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MemoryBuiltins.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
MemoryDependenceAnalysis.cpp [AliasAnalysis] Introduce getModRefInfoMask() as a generalization of pointsToConstantMemory(). 2022-10-31 13:03:41 -07:00
MemoryLocation.cpp MemoryLocation: convert Optional to std::optional 2022-12-01 15:36:20 -08:00
MemoryProfileInfo.cpp Restore "[MemProf] ThinLTO summary support" with more fixes 2022-11-16 09:42:41 -08:00
MemorySSA.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:12:44 -08:00
MemorySSAUpdater.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
ModelUnderTrainingRunner.cpp [mlgo][nfc] Make `LoggedFeatureSpec` an implementation detail 2022-11-30 15:57:58 -08:00
ModuleDebugInfoPrinter.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
ModuleSummaryAnalysis.cpp ModuleSummaryAnalysis: Internalize some cl::opt 2022-11-23 17:33:34 -08:00
MustExecute.cpp [MustExec][LICM] Handle latch being part of an inner cycle (PR57780) 2022-10-11 09:30:13 +02:00
NoInferenceModelRunner.cpp [mlgo] Support exposing more features than those supported by models 2022-05-09 18:01:21 -07:00
ObjCARCAliasAnalysis.cpp [AliasAnalysis] Introduce getModRefInfoMask() as a generalization of pointsToConstantMemory(). 2022-10-31 13:03:41 -07:00
ObjCARCAnalysisUtils.cpp
ObjCARCInstKind.cpp [ObjCARC] Use "UnsafeClaimRV" to refer to unsafeClaim in enums. NFC. 2022-01-24 19:37:01 -08:00
OptimizationRemarkEmitter.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
OverflowInstAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
PHITransAddr.cpp [PHITranslateAddr] Require dominance when searching for translated address (PR57025) 2022-09-01 16:26:42 +02:00
PhiValues.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:12:44 -08:00
PtrUseVisitor.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
README.txt
RegionInfo.cpp [NFC] Remove unnecessary #includes 2022-02-04 21:22:41 -08:00
RegionPass.cpp Use PassGate from LLVMContext if any otherwise global one 2022-11-25 15:13:04 +07:00
RegionPrinter.cpp [polly] migrate -polly-show to the new pass manager 2022-05-09 14:04:29 -05:00
ReplayInlineAdvisor.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
ScalarEvolution.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:12:44 -08:00
ScalarEvolutionAliasAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ScalarEvolutionDivision.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ScalarEvolutionNormalization.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
ScopedNoAliasAA.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
StackLifetime.cpp [StackLifetime] More efficient loop for LivenessType::Must 2022-09-28 16:28:45 -07:00
StackSafetyAnalysis.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
StratifiedSets.h [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
SyncDependenceAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
SyntheticCountsUtils.cpp [llvm] Don't use Optional::getValue (NFC) 2022-06-20 22:45:45 -07:00
TFLiteUtils.cpp [mlgo][nfc] Make `LoggedFeatureSpec` an implementation detail 2022-11-30 15:57:58 -08:00
TFUtils.cpp [mlgo] Use TFLite for 'development' mode. 2022-08-24 16:07:24 -07:00
TargetLibraryInfo.cpp [Analysis][SimplifyLibCalls] Refactor code related to size_t in lib func signatures. NFC 2022-10-03 12:02:50 +02:00
TargetTransformInfo.cpp [AArch64] Enable the select optimize pass for AArch64 2022-12-03 16:08:58 +00:00
TensorSpec.cpp [Analysis] Use std::nullopt instead of None (NFC) 2022-12-02 19:43:04 -08:00
Trace.cpp
TrainingLogger.cpp [mlgo][nfc] Virtualize Logger implementation 2022-12-01 16:03:08 -08:00
TypeBasedAliasAnalysis.cpp [AliasAnalysis] Introduce getModRefInfoMask() as a generalization of pointsToConstantMemory(). 2022-10-31 13:03:41 -07:00
TypeMetadataUtils.cpp [NFC]] Use llvm::all_of instead of std::all_of 2022-08-23 12:21:53 +08:00
VFABIDemangling.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:12:44 -08:00
ValueLattice.cpp [ValueLattice] Fix typo in condition (NFC) 2022-11-02 17:52:13 +01:00
ValueLatticeUtils.cpp [SCCP] Check that load/store and global type match 2022-02-11 11:01:18 +01:00
ValueTracking.cpp [llvm] Use std::nullopt instead of None in comments (NFC) 2022-12-04 17:12:44 -08:00
VectorUtils.cpp [VectorUtils] Skip interleave members with diff type and alloca sizes. 2022-11-13 22:06:20 +00:00

README.txt

Analysis Opportunities:

//===---------------------------------------------------------------------===//

In test/Transforms/LoopStrengthReduce/quadradic-exit-value.ll, the
ScalarEvolution expression for %r is this:

  {1,+,3,+,2}<loop>

Outside the loop, this could be evaluated simply as (%n * %n), however
ScalarEvolution currently evaluates it as

  (-2 + (2 * (trunc i65 (((zext i64 (-2 + %n) to i65) * (zext i64 (-1 + %n) to i65)) /u 2) to i64)) + (3 * %n))

In addition to being much more complicated, it involves i65 arithmetic,
which is very inefficient when expanded into code.

//===---------------------------------------------------------------------===//

In formatValue in test/CodeGen/X86/lsr-delayed-fold.ll,

ScalarEvolution is forming this expression:

((trunc i64 (-1 * %arg5) to i32) + (trunc i64 %arg5 to i32) + (-1 * (trunc i64 undef to i32)))

This could be folded to

(-1 * (trunc i64 undef to i32))

//===---------------------------------------------------------------------===//