1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00
llvm-mirror/lib/Analysis
Arthur Eubanks 4fce57098e [NewPM] Make pass adaptors less templatey
Currently PassBuilder.cpp is by far the file that takes longest to
compile. This is due to tons of templates being instantiated per pass.

Follow PassManager by using wrappers around passes to avoid making
the adaptors templated on the pass type. This allows us to move various
adaptors' run methods into .cpp files.

This reduces the compile time of PassBuilder.cpp on my machine from 66
to 39 seconds. It also reduces the size of opt from 685M to 676M.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D92616
2020-12-04 08:30:50 -08:00
..
models/inliner
AliasAnalysis.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
AliasAnalysisEvaluator.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
AliasAnalysisSummary.cpp
AliasAnalysisSummary.h
AliasSetTracker.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
Analysis.cpp [NPM] Port module-debuginfo pass to the new pass manager 2020-10-19 14:31:17 -07:00
AssumeBundleQueries.cpp
AssumptionCache.cpp [Analysis] findAffectedValues - remove unused ConstantInt argument. NFCI. 2020-10-13 14:35:18 +01:00
BasicAliasAnalysis.cpp [BasicAA] Generalize recursive phi alias analysis 2020-11-29 10:25:23 +01:00
BlockFrequencyInfo.cpp
BlockFrequencyInfoImpl.cpp
BranchProbabilityInfo.cpp [BPI] Look through bitcasts in calcZeroHeuristic 2020-11-17 09:33:05 -08:00
CallGraph.cpp
CallGraphSCCPass.cpp [NewPM] Support --print-before/after in NPM 2020-12-03 16:52:14 -08:00
CallPrinter.cpp
CaptureTracking.cpp [CaptureTracking] Add statistics (NFC) 2020-11-07 12:57:00 +01:00
CFG.cpp [CFG] Replace hardcoded max BBs explored as CL option. NFC. 2020-10-30 15:11:48 -04:00
CFGPrinter.cpp
CFLAndersAliasAnalysis.cpp [MemLoc] Use hasValue() method (NFC) 2020-11-19 21:53:50 +01:00
CFLGraph.h
CFLSteensAliasAnalysis.cpp
CGSCCPassManager.cpp [NewPM] Make pass adaptors less templatey 2020-12-04 08:30:50 -08:00
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
CmpInstAnalysis.cpp
CodeMetrics.cpp
ConstantFolding.cpp [llvm][IR] Add dso_local_equivalent Constant 2020-11-19 10:26:17 -08:00
ConstraintSystem.cpp [ConstraintSystem] Remove local variable that is set but not read [NFC] 2020-09-17 14:26:48 +02:00
CostModel.cpp [CostModel] add cl option to check size and latency costs; NFC 2020-09-27 09:52:56 -04:00
DDG.cpp
Delinearization.cpp [Delinearization][NewPM] Port delinearization to NPM 2020-09-21 17:59:08 -07:00
DemandedBits.cpp
DependenceAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
DependenceGraphBuilder.cpp
DevelopmentModeInlineAdvisor.cpp [NFC][TFUtils] also include output specs lookup logic in loadOutputSpecs 2020-11-18 21:20:21 -08:00
DivergenceAnalysis.cpp [Analysis] Remove unused system header includes 2020-11-22 10:32:37 +00:00
DominanceFrontier.cpp
DomPrinter.cpp
DomTreeUpdater.cpp [Analysis] Use llvm::is_contained (NFC) 2020-11-20 18:08:05 -08:00
EHPersonalities.cpp [XCOFF][AIX] Generate LSDA data and compact unwind section on AIX 2020-12-02 18:42:44 +00:00
FunctionPropertiesAnalysis.cpp
GlobalsModRef.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
GuardUtils.cpp
HeatUtils.cpp
IndirectCallPromotionAnalysis.cpp [Analysis] Remove unused system header includes 2020-11-22 10:32:37 +00:00
InlineAdvisor.cpp [llvm][inliner] Reuse the inliner pass to implement 'always inliner' 2020-11-30 12:03:39 -08:00
InlineCost.cpp [Inline] prevent inlining on stack protector mismatch 2020-12-02 11:00:16 -08:00
InlineSizeEstimatorAnalysis.cpp
InstCount.cpp
InstructionPrecedenceTracking.cpp
InstructionSimplify.cpp [InstSimplify] Clarify use of FixedVectorType in SimplifySelectInst 2020-11-27 09:55:29 +00:00
Interval.cpp
IntervalPartition.cpp
IRSimilarityIdentifier.cpp [IRSim] Adding wrapper pass for IRSimilarityIdentfier 2020-09-24 14:59:41 -05:00
IVDescriptors.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
IVUsers.cpp
LazyBlockFrequencyInfo.cpp
LazyBranchProbabilityInfo.cpp
LazyCallGraph.cpp [LazyCallGraph] Build SCCs of the reference graph in order 2020-11-02 13:22:42 -08:00
LazyValueInfo.cpp [LVI][CVP] Use block value when simplifying icmps 2020-09-27 20:25:16 +02:00
LegacyDivergenceAnalysis.cpp [DivergenceAnalysis] Use addRequiredTransitive 2020-11-13 14:40:00 +01:00
Lint.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
Loads.cpp Use deref facts derived from minimum object size of allocations 2020-12-03 15:01:14 -08:00
LoopAccessAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
LoopAnalysisManager.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
LoopCacheAnalysis.cpp [LoopInfo] empty() -> isInnermost(), add isOutermost() 2020-09-22 23:28:51 +03:00
LoopInfo.cpp [NewPM] Support --print-before/after in NPM 2020-12-03 16:52:14 -08:00
LoopNestAnalysis.cpp [LoopInfo] empty() -> isInnermost(), add isOutermost() 2020-09-22 23:28:51 +03:00
LoopPass.cpp [NewPM] Support --print-before/after in NPM 2020-12-03 16:52:14 -08:00
LoopUnrollAnalyzer.cpp
MemDepPrinter.cpp
MemDerefPrinter.cpp Port -print-memderefs to NPM 2020-11-23 11:56:22 -08:00
MemoryBuiltins.cpp Analysis: only query size of sized objects. 2020-10-14 12:16:05 +01:00
MemoryDependenceAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
MemoryLocation.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
MemorySSA.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
MemorySSAUpdater.cpp [MemorySSA] Rename uses in blocks with Phis. 2020-09-16 17:24:17 -07:00
MLInlineAdvisor.cpp [llvm][inliner] Reuse the inliner pass to implement 'always inliner' 2020-11-30 12:03:39 -08:00
ModuleDebugInfoPrinter.cpp [NPM] Port module-debuginfo pass to the new pass manager 2020-10-19 14:31:17 -07:00
ModuleSummaryAnalysis.cpp
MustExecute.cpp Port print-must-be-executed-contexts and print-mustexecute to NPM 2020-11-03 21:06:46 -08:00
ObjCARCAliasAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
ObjCARCAnalysisUtils.cpp [NFC] Reduce include files dependency. 2020-12-03 18:25:05 +03:00
ObjCARCInstKind.cpp
OptimizationRemarkEmitter.cpp [Remarks][2/2] Expand remarks hotness threshold option support in more tools 2020-11-30 21:55:50 -08:00
PHITransAddr.cpp
PhiValues.cpp [PhiValues] Use SetVector to avoid non-determinism 2020-10-23 20:14:02 +02:00
PostDominators.cpp
ProfileSummaryInfo.cpp
PtrUseVisitor.cpp
README.txt
RegionInfo.cpp
RegionPass.cpp [NFC] Clean up always false variables 2020-10-21 10:54:55 -07:00
RegionPrinter.cpp
ReleaseModeModelRunner.cpp static const char *const foo => const char foo[] 2020-12-01 10:33:18 -08:00
ReplayInlineAdvisor.cpp
ScalarEvolution.cpp Revert "Return "[SCEV] Use isBasicBlockEntryGuardedByCond in isLoopBackedgeGuardedByCond", 2nd try" 2020-11-26 18:12:51 +07:00
ScalarEvolutionAliasAnalysis.cpp [AA] Split up LocationSize::unknown() 2020-11-26 18:39:55 +01:00
ScalarEvolutionDivision.cpp [SCEV] Generalize SCEVParameterRewriter to accept SCEV expression as target. 2020-09-18 10:05:02 +01:00
ScalarEvolutionNormalization.cpp
ScopedNoAliasAA.cpp [MemCpyOpt] Correctly merge alias scopes during call slot optimization 2020-12-03 09:23:37 -08:00
StackLifetime.cpp
StackSafetyAnalysis.cpp [Analysis] resolveAllCalls - fix use after std::move warning. NFCI. 2020-10-03 17:52:20 +01:00
StratifiedSets.h
SyncDependenceAnalysis.cpp [SDA] Fix -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off builds 2020-10-04 12:17:16 -07:00
SyntheticCountsUtils.cpp
TargetLibraryInfo.cpp Initial support for vectorization using Libmvec (GLIBC vector math library) 2020-10-22 16:01:39 -04:00
TargetTransformInfo.cpp [NFC][CostModel]Extend class IntrinsicCostAttributes to use ElementCount Type 2020-12-01 11:12:51 +00:00
TFUtils.cpp [NFC][TFUtils] also include output specs lookup logic in loadOutputSpecs 2020-11-18 21:20:21 -08:00
Trace.cpp
TypeBasedAliasAnalysis.cpp
TypeMetadataUtils.cpp
ValueLattice.cpp
ValueLatticeUtils.cpp
ValueTracking.cpp [ValueTracking] Fix assert on shufflevector of pointers 2020-11-27 21:19:31 +01:00
VectorUtils.cpp [JumpThreading][VectorUtils] avoid infinite loop on unreachable IR 2020-12-02 13:39:33 -05:00
VFABIDemangling.cpp

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))

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