llvm-project/llvm/lib/Analysis
Max Kazantsev e5fa7eb120 [SCEV] Add printout of symbolic max backedge-taken and block exit count
We do compute it and use in optimizations, but never print it out. We need
to do it in order to be able to track improvements in its computation.
2022-11-24 19:29:58 +07:00
..
models Reland "[MLGO] ML Regalloc Priority Advisor" 2022-09-30 16:27:26 -05:00
AliasAnalysis.cpp [AA] Remove some overloads (NFC) 2022-11-02 10:21:10 +01:00
AliasAnalysisEvaluator.cpp [AA] Do not track Must in ModRefInfo 2022-08-01 07:14:31 +02:00
AliasAnalysisSummary.cpp
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 [AA] Move MayBeCrossIteration into AAQI (NFC) 2022-11-14 16:42:22 +01:00
BlockFrequencyInfo.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
BlockFrequencyInfoImpl.cpp [llvm] Remove unneeded cl::ZeroOrMore for cl::opt options. NFC 2022-06-03 21:59:05 -07:00
BranchProbabilityInfo.cpp [PGO] Support PGO annotation of CallBrInst 2022-09-01 14:13:50 -07: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] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
CFLGraph.h [MemoryBuiltins] Remove isFreeCall() function (NFC) 2022-07-21 14:44:23 +02:00
CFLSteensAliasAnalysis.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
CGSCCPassManager.cpp [CGSCC][DevirtWrapper] Properly handle invalidating analyses for invalidated SCCs 2022-09-29 09:55:23 -07: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 [NFC] Rename Instrinsic to Intrinsic 2022-04-25 18:13:23 +01: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 ConstantFolding: Constant fold some canonicalizes 2022-11-18 10:35:19 -08: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
DevelopmentModeInlineAdvisor.cpp [nfc][mlgo] Separate logger and training-mode model evaluator 2022-08-03 16:20:28 -07: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 [PS5] Use __gxx_personality_v0 for TSan 2022-06-14 10:39:34 -07:00
FunctionPropertiesAnalysis.cpp [FunctionPropertiesAnalysis] Generalize support for unreachable 2022-06-21 08:18:01 -07:00
GlobalsModRef.cpp [AA] Rename getModRefBehavior() to getMemoryEffects() (NFC) 2022-10-19 11:03:54 +02: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
IndirectCallPromotionAnalysis.cpp Remove unneeded cl::ZeroOrMore for cl::opt options 2022-06-04 00:10:42 -07:00
InlineAdvisor.cpp [MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal 2022-11-24 03:48:34 +00:00
InlineCost.cpp [Analysis] Introduce getStaticBonusApplied (NFC) 2022-09-25 23:21:40 -07:00
InlineOrder.cpp [ModuleInliner] Add a cost-benefit-based priority 2022-09-29 09:00:38 -07:00
InlineSizeEstimatorAnalysis.cpp Fix build breaks on ml-* bots introduced by include cleanups 2022-03-01 11:29:18 -08:00
InstCount.cpp
InstructionPrecedenceTracking.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
InstructionSimplify.cpp InstSimplify: Fold arithmetic_fence as idempotent 2022-11-15 22:29:34 -08: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 [LVI] Improve debug message (NFC) 2022-11-04 16:58:02 +01:00
LegacyDivergenceAnalysis.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
Lint.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
Loads.cpp [Analysis] `isSafeToLoadUnconditionally()`: `lifetime` intrinsics can be ignored 2022-11-17 20:48:27 +03:00
LoopAccessAnalysis.cpp [LAA] Use LoopAccessInfoManager in legacy pass. 2022-10-04 08:37:11 +01:00
LoopAnalysisManager.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
LoopCacheAnalysis.cpp [Analysis] Use llvm::Optional::value_or (NFC) 2022-11-19 21:11:10 -08:00
LoopInfo.cpp [Analysis] Teach getOptionalIntLoopAttribute to return std::optional (NFC) 2022-11-19 15:36:50 -08:00
LoopNestAnalysis.cpp [NFC] Use BB->size() instead of BB->getInstList().size(). 2022-11-23 17:25:53 -08:00
LoopPass.cpp [LegacyPassManager] Move structural hashing into Pass classes. NFC. 2022-03-17 09:51:12 +00: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 MemoryBuiltins: Don't check for unsized allocas 2022-11-16 09:13:11 -08:00
MemoryDependenceAnalysis.cpp [AliasAnalysis] Introduce getModRefInfoMask() as a generalization of pointsToConstantMemory(). 2022-10-31 13:03:41 -07:00
MemoryLocation.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MemoryProfileInfo.cpp Restore "[MemProf] ThinLTO summary support" with more fixes 2022-11-16 09:42:41 -08:00
MemorySSA.cpp [MemorySSA] Relax assert condition in createDefinedAccess 2022-11-17 23:43:20 +08:00
MemorySSAUpdater.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
ModelUnderTrainingRunner.cpp [MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal 2022-11-24 03:48:34 +00: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
OptimizationRemarkEmitter.cpp [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07: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 [CSSPGO] Move cl::opt inside llvm:: after D100528 and D108342 2022-11-23 23:08:49 -08:00
PtrUseVisitor.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
README.txt
RegionInfo.cpp
RegionPass.cpp [LegacyPassManager] Move structural hashing into Pass classes. NFC. 2022-03-17 09:51:12 +00:00
RegionPrinter.cpp [polly] migrate -polly-show to the new pass manager 2022-05-09 14:04:29 -05:00
ReplayInlineAdvisor.cpp [Inline] Annotate inline pass name with link phase information for analysis. 2022-06-24 10:06:43 -07:00
ScalarEvolution.cpp [SCEV] Add printout of symbolic max backedge-taken and block exit count 2022-11-24 19:29:58 +07: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 [llvm] Use Optional::has_value instead of Optional::hasValue (NFC) 2022-06-26 16:10:42 -07: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 Move interpreter check before modifying the allocation type. 2022-10-12 19:50:36 +00: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 [AMDGPU] Allow finer grain control of an unaligned access speed 2022-11-17 09:23:53 -08:00
TensorSpec.cpp [mlgo] Factor out TensorSpec 2022-04-25 18:35:46 -07:00
Trace.cpp
TrainingLogger.cpp [nfc][mlgo] Separate logger and training-mode model evaluator 2022-08-03 16:20:28 -07: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 [NFC] Fix a few whitespace inconsistencies. 2022-10-20 14:52:25 +00: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 [Analysis] Remove getInverseMinMaxPred 2022-11-20 13:30:19 -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))

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