llvm-project/llvm/lib/Analysis
Kazu Hirata 6e30a9cc08 [Inliner] Retire DefaultInlineOrder (NFC)
DefaultInlineOrder was largely an exercise in generalizing the
traversal order of call sites within the inliner.

Now that the module inliner is starting to form its shape, there is no
point in sharing DefaultInlineOrder between the module inliner and the
CGSCC inliner.  DefaultInlineOrder and all the other inline orders are
mutually exclusive in the following sense:

- The use of DefaultInlineOrder doesn't make sense in the module
  inliner because there is no priority inherent in the order in which
  call sites are added to the list of call sites -- SmallVector.

- The use of any other inline order doesn't make sense in the CGSCC
  inliner because little prioritization can be done within one CGSCC.

This patch essentially reverts the addition of DefaultInlineOrder so
that the loop structure of Inliner.cpp looks like the state just
before we started working on the module inliner (circa June 2021).

At the same time, ww remove the choice of DefaultInlineOrder from
UseInlinePriority.

Differential Revision: https://reviews.llvm.org/D134080
2022-09-16 15:36:40 -07:00
..
models [mlgo] Fix flaky test 2022-08-26 21:29:25 -07:00
AliasAnalysis.cpp [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI) 2022-09-14 16:34:41 +02:00
AliasAnalysisEvaluator.cpp [AA] Do not track Must in ModRefInfo 2022-08-01 07:14:31 +02:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI) 2022-09-14 16:34:41 +02:00
Analysis.cpp [DomPrinter] Migrate -dot-dom to the new pass manager. 2022-05-16 15:07:16 -05: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] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI) 2022-09-14 16:34:41 +02: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 [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
CFGPrinter.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01: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 [Clang] Reimplement time tracing of NewPassManager by PassInstrumentation framework 2022-09-11 05:42:55 -07:00
CMakeLists.txt [CMake][MLGO] Fix cmake for MLGO 2022-09-06 00:32:08 -07:00
CallGraph.cpp [CallGraph] Don't preserve CallGraph when function CFG analyses are preserved 2022-06-19 13:01:08 -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 [ConstantExpr] Don't create fneg expressions 2022-09-07 11:27:25 +02:00
ConstraintSystem.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
CostModel.cpp [Analysis] CostModel.cpp - merge isa<IntrinsicInst> and dyn_cast<IntrinsicInst> checks 2022-08-18 10:43:29 +01: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 [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] Switch a few uses of undef to poison as placeholders for unreachable code 2022-07-30 13:55:56 +01: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] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI) 2022-09-14 16:34:41 +02:00
GuardUtils.cpp
HeatUtils.cpp
IRSimilarityIdentifier.cpp [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
IVDescriptors.cpp [LV] Support fixed order recurrences. 2022-08-18 19:15:52 +01: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 [Analysis] clang-format InlineAdvisor.cpp (NFC) 2022-07-13 13:38:50 -07:00
InlineCost.cpp [CostModel] Replace getUserCost with getInstructionCost 2022-08-18 11:55:23 +01:00
InlineOrder.cpp [Inliner] Retire DefaultInlineOrder (NFC) 2022-09-16 15:36:40 -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] allow poison/undef in constant match for "C - X ==/!= X -> false/true" 2022-09-06 08:19:30 -04:00
Interval.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
IntervalPartition.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp [LazyCallGraph] Reformat the code in accordance with the code style. NFC 2022-08-30 11:06:42 +03:00
LazyValueInfo.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07: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 [InstCombine][SVE] Bail out of isSafeToLoadUnconditionally for scalable types 2022-07-13 10:07:36 +00:00
LoopAccessAnalysis.cpp [llvm] Use llvm::find_if (NFC) 2022-08-28 10:41:48 -07:00
LoopAnalysisManager.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
LoopCacheAnalysis.cpp Revert "[llvm] Use llvm::is_contained (NFC)" 2022-08-28 18:52:49 -07:00
LoopInfo.cpp [LoopInfo] Allow cloning of callbr 2022-07-19 09:57:28 +02:00
LoopNestAnalysis.cpp Revert "[LoopPassManager] Implement and use LoopNestAnalysis::run() instead of manually creating LoopNests" 2022-09-05 15:42:48 -07: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 [MLInliner] No need to invalidate everything post-inlining. 2022-06-24 18:22:06 -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 [BoundsChecking] Fix merging of sizes 2022-08-03 17:21:19 -07:00
MemoryDependenceAnalysis.cpp [llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 11:24:15 -07:00
MemoryLocation.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MemoryProfileInfo.cpp [llvm] Qualify auto (NFC) 2022-08-07 23:55:27 -07:00
MemorySSA.cpp [MSSA] Fix expensive checks build 2022-08-01 07:28:52 +02:00
MemorySSAUpdater.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
ModelUnderTrainingRunner.cpp [iwyu] Handle regressions in libLLVM header include 2022-05-26 08:12:34 +02:00
ModuleDebugInfoPrinter.cpp [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -07:00
ModuleSummaryAnalysis.cpp [WPD] Use new llvm.public.type.test intrinsic for potentially publicly visible classes 2022-07-26 08:01:08 -07:00
MustExecute.cpp Use drop_begin (NFC) 2022-07-31 15:17:09 -07:00
NoInferenceModelRunner.cpp [mlgo] Support exposing more features than those supported by models 2022-05-09 18:01:21 -07:00
ObjCARCAliasAnalysis.cpp [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI) 2022-09-14 16:34:41 +02: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 [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07: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 [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 Use std::gcd (NFC) 2022-08-27 21:20:59 -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 [Analysis] Qualify auto variables in for loops (NFC) 2022-07-16 23:26:34 -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 [MLGO] Make TFLiteUtils throw an error if some features haven't been passed to the model 2022-09-10 22:59:03 +00:00
TFUtils.cpp [mlgo] Use TFLite for 'development' mode. 2022-08-24 16:07:24 -07:00
TargetLibraryInfo.cpp [InstCombine] Tighten up known library function signature tests (PR #56463) 2022-08-10 14:15:46 -06:00
TargetTransformInfo.cpp Move TargetTransformInfo::maxLegalDivRemBitWidth -> TargetLowering::maxSupportedDivRemBitWidth 2022-09-12 17:06:16 +01: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 [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI) 2022-09-14 16:34:41 +02:00
TypeMetadataUtils.cpp [NFC]] Use llvm::all_of instead of std::all_of 2022-08-23 12:21:53 +08:00
VFABIDemangling.cpp Use llvm::count_if (NFC) 2022-09-03 11:17:35 -07:00
ValueLattice.cpp
ValueLatticeUtils.cpp [SCCP] Check that load/store and global type match 2022-02-11 11:01:18 +01:00
ValueTracking.cpp [ValueTracking][InstCombine] restrict FP min/max matching to avoid miscompile 2022-08-25 16:52:40 -04:00
VectorUtils.cpp [ADT] Deprecate is_splat and replace all uses with all_equal 2022-08-23 11:36:27 -04: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))

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