llvm-project/llvm/lib/Analysis
Alexey Bataev 2f49163b33 [DAG]Introduce llvm::processShuffleMasks and use it for shuffles in DAG Type Legalizer.
We can process the long shuffles (working across several actual
vector registers) in the best way if we take the actual register
represantion into account. We can build more correct representation of
register shuffles, improve number of recognised buildvector sequences.
Also, same function can be used to improve the cost model for the
shuffles. in future patches.

Part of D100486

Differential Revision: https://reviews.llvm.org/D115653
2022-04-20 05:32:56 -07:00
..
models [MLGO] ML Regalloc Eviction Advisor 2022-01-19 11:00:32 -08:00
AliasAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
AliasAnalysisEvaluator.cpp Cleanup includes: final pass 2022-03-29 09:00:21 +02:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
Analysis.cpp Reapply CycleInfo: Introduce cycles as a generalization of loops 2021-12-10 14:36:43 +05:30
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 [CaptureTracking] Ignore ephemeral values in EarliestEscapeInfo 2022-04-08 10:07:26 -07:00
BlockFrequencyInfo.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
BlockFrequencyInfoImpl.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
BranchProbabilityInfo.cpp [NFC] Add missing <map> includes 2022-01-19 12:29:03 +01:00
CFG.cpp
CFGPrinter.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
CFLAndersAliasAnalysis.cpp
CFLGraph.h
CFLSteensAliasAnalysis.cpp [llvm] Remove redundant member initialization (NFC) 2022-01-07 17:45:09 -08:00
CGSCCPassManager.cpp [CGSCC] Use make_early_inc_range. NFC 2022-03-23 15:31:09 -07:00
CMakeLists.txt [NFC][mlgo]Make the test model generator inlining-specific 2021-12-22 13:38:45 -08:00
CallGraph.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
CallGraphSCCPass.cpp [LegacyPassManager] Move structural hashing into Pass classes. NFC. 2022-03-17 09:51:12 +00:00
CallPrinter.cpp [CallPrinter] Port CallPrinter passes to new pass manager 2022-04-18 10:02:18 -07:00
CaptureTracking.cpp [CaptureTracking] Ignore ephemeral values in EarliestEscapeInfo 2022-04-08 10:07:26 -07:00
CmpInstAnalysis.cpp [InstCombine][Analysis] Move getFCmpCode and getPredForFCmpCode to CmpInstAnalysis. NFC 2022-03-03 09:33:24 -08:00
CodeMetrics.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ConstantFolding.cpp [ConstFold] Don't fold calls with mismatching function type 2022-03-11 14:09:23 +01:00
ConstraintSystem.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
CostModel.cpp [CostModel] Change printer pass wording to work with update_analyze_test_checks.py 2022-03-03 10:10:48 -08:00
CycleAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
DDG.cpp [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
DDGPrinter.cpp
Delinearization.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
DemandedBits.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
DependenceAnalysis.cpp [DA] Refactor with a better API 2022-04-13 14:51:48 -04:00
DependenceGraphBuilder.cpp [NFC] Remove unnecessary #includes 2022-02-04 21:22:41 -08:00
DevelopmentModeInlineAdvisor.cpp Cleanup includes: DebugInfo & CodeGen 2022-03-12 17:26:40 +01:00
DivergenceAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
DomPrinter.cpp Introduce NewPM .dot printers for DomTree 2022-01-05 23:25:40 +00:00
DomTreeUpdater.cpp [DomTreeUpdater] Remove deprecated methods 2022-04-20 12:14:29 +02:00
DominanceFrontier.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
EHPersonalities.cpp
FunctionPropertiesAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
GlobalsModRef.cpp [GlobalsModRef][FIX] Ensure we honor synchronizing effects of intrinsics 2022-04-12 16:42:50 -05:00
GuardUtils.cpp
HeatUtils.cpp [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
IRSimilarityIdentifier.cpp [IRSim] Ignore debug instructions when creating canonical numbering 2022-04-19 13:18:28 -05:00
IVDescriptors.cpp [IVDescriptors] Bail out instead of asserting that order is expected. 2022-03-07 19:57:26 +00:00
IVUsers.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ImportedFunctionsInliningStatistics.cpp
IndirectCallPromotionAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
InlineAdvisor.cpp [Analysis] Apply clang-tidy fixes for readability-redundant-smartptr-get (NFC) 2022-03-20 18:21:40 -07:00
InlineCost.cpp [InlineCost] Check that function types match 2022-04-12 11:05:33 +02: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 Revert "[IPT] Restructure cache to allow lazy update following invalidation [NFC]" 2021-10-21 10:48:41 -07:00
InstructionSimplify.cpp [FPEnv][InstSimplify] Fold fsub -0.0, -X ==> X 2022-04-14 11:48:54 -04:00
Interval.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
IntervalPartition.cpp [llvm] Use range-based for loops (NFC) 2021-11-20 18:42:10 -08:00
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp Add missing include under EXPENSIVE_CHECKS 2022-03-12 18:54:29 +01:00
LazyValueInfo.cpp [NFC] Add LazyValueInfo::clear method 2022-03-15 17:52:50 +07:00
LegacyDivergenceAnalysis.cpp [NFC] Remove unnecessary #includes 2022-02-04 21:22:41 -08:00
Lint.cpp [Lint][Verifier] NFC: Rename 'Assert*' macros to 'Check*'. 2022-04-05 15:34:35 -04:00
Loads.cpp [Loads] Check type size in bits during store to load forwarding 2022-04-08 17:29:29 +02:00
LoopAccessAnalysis.cpp [Analysis] Apply clang-tidy fixes for readability-redundant-smartptr-get (NFC) 2022-03-20 18:21:40 -07:00
LoopAnalysisManager.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
LoopCacheAnalysis.cpp [Analysis] Apply clang-tidy fixes for readability-redundant-smartptr-get (NFC) 2022-03-20 18:21:40 -07:00
LoopInfo.cpp Fix warnings about variables that are set but only used in debug mode 2022-04-06 10:01:46 +03:00
LoopNestAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
LoopPass.cpp [LegacyPassManager] Move structural hashing into Pass classes. NFC. 2022-03-17 09:51:12 +00:00
LoopUnrollAnalyzer.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MLInlineAdvisor.cpp Fix build breaks on ml-* bots introduced by include cleanups 2022-03-01 11:29:18 -08: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 Revert "[ValueTracking] Make getStringLenth aware of strdup" 2022-04-13 19:17:28 +02:00
MemoryDependenceAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MemoryLocation.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
MemorySSA.cpp [MSSA] Print memory phis when inspecting walker. 2022-04-06 16:06:14 -07:00
MemorySSAUpdater.cpp Fix MemorySSAUpdater::insertDef for dead code 2022-03-31 16:32:35 -07:00
ModelUnderTrainingRunner.cpp [NFC][MLGO] Remove the word "inliner" in a generic error message. 2022-01-11 12:39:16 -08:00
ModuleDebugInfoPrinter.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ModuleSummaryAnalysis.cpp [LTO] Initialize canAutoHide() using canBeOmittedFromSymbolTable() 2022-03-03 19:04:11 -05:00
MustExecute.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
NoInferenceModelRunner.cpp [NFC][MLGO]Add RTTI support for MLModelRunner and simplify runner setup 2022-01-04 19:46:14 -08:00
ObjCARCAliasAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01: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] Apply clang-tidy fixes for readability-redundant-smartptr-get (NFC) 2022-03-20 18:21:40 -07:00
OverflowInstAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
PHITransAddr.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
PhiValues.cpp
PostDominators.cpp
ProfileSummaryInfo.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01: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 Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ReplayInlineAdvisor.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ScalarEvolution.cpp [SCEV] Use constant ranges when determining reachable blocks (PR54434) 2022-03-18 12:04:35 +01: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 Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
StackSafetyAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
StratifiedSets.h
SyncDependenceAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
SyntheticCountsUtils.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
TFUtils.cpp [MLGO] Add support for multiple training traces per module 2022-01-11 16:13:31 -08:00
TargetLibraryInfo.cpp [TLI] Check that malloc argument has type size_t 2022-03-14 17:22:24 +01:00
TargetTransformInfo.cpp Revert "[AArch64] Set maximum VF with shouldMaximizeVectorBandwidth" 2022-04-13 04:53:07 +05:00
Trace.cpp
TypeBasedAliasAnalysis.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
TypeMetadataUtils.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
VFABIDemangling.cpp Cleanup includes: LLVMAnalysis 2022-03-01 18:01:54 +01:00
ValueLattice.cpp
ValueLatticeUtils.cpp [SCCP] Check that load/store and global type match 2022-02-11 11:01:18 +01:00
ValueTracking.cpp Revert "[ValueTracking] Make getStringLenth aware of strdup" 2022-04-13 19:17:28 +02:00
VectorUtils.cpp [DAG]Introduce llvm::processShuffleMasks and use it for shuffles in DAG Type Legalizer. 2022-04-20 05:32:56 -07: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))

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