2010-10-07 06:17:38 +02:00
|
|
|
//===- llvm/InitializePasses.h -------- Initialize All Passes ---*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the declarations for the pass initialization routines
|
|
|
|
// for the entire LLVM project.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_INITIALIZEPASSES_H
|
|
|
|
#define LLVM_INITIALIZEPASSES_H
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class PassRegistry;
|
|
|
|
|
2011-01-29 02:09:53 +01:00
|
|
|
/// initializeCore - Initialize all passes linked into the
|
2010-10-07 21:51:21 +02:00
|
|
|
/// TransformUtils library.
|
|
|
|
void initializeCore(PassRegistry&);
|
|
|
|
|
2011-01-29 02:09:53 +01:00
|
|
|
/// initializeTransformUtils - Initialize all passes linked into the
|
2010-10-07 19:55:47 +02:00
|
|
|
/// TransformUtils library.
|
|
|
|
void initializeTransformUtils(PassRegistry&);
|
|
|
|
|
2011-01-29 02:09:53 +01:00
|
|
|
/// initializeScalarOpts - Initialize all passes linked into the
|
2010-10-07 19:55:47 +02:00
|
|
|
/// ScalarOpts library.
|
|
|
|
void initializeScalarOpts(PassRegistry&);
|
|
|
|
|
2012-02-01 04:51:43 +01:00
|
|
|
/// initializeVectorization - Initialize all passes linked into the
|
|
|
|
/// Vectorize library.
|
|
|
|
void initializeVectorization(PassRegistry&);
|
|
|
|
|
2011-01-29 02:09:53 +01:00
|
|
|
/// initializeInstCombine - Initialize all passes linked into the
|
2010-10-07 22:04:55 +02:00
|
|
|
/// ScalarOpts library.
|
|
|
|
void initializeInstCombine(PassRegistry&);
|
|
|
|
|
2010-10-07 20:09:59 +02:00
|
|
|
/// initializeIPO - Initialize all passes linked into the IPO library.
|
|
|
|
void initializeIPO(PassRegistry&);
|
|
|
|
|
2010-10-07 22:17:24 +02:00
|
|
|
/// initializeInstrumentation - Initialize all passes linked into the
|
|
|
|
/// Instrumentation library.
|
|
|
|
void initializeInstrumentation(PassRegistry&);
|
|
|
|
|
2010-10-07 20:31:00 +02:00
|
|
|
/// initializeAnalysis - Initialize all passes linked into the Analysis library.
|
|
|
|
void initializeAnalysis(PassRegistry&);
|
|
|
|
|
|
|
|
/// initializeIPA - Initialize all passes linked into the IPA library.
|
|
|
|
void initializeIPA(PassRegistry&);
|
|
|
|
|
2010-10-07 20:41:20 +02:00
|
|
|
/// initializeCodeGen - Initialize all passes linked into the CodeGen library.
|
|
|
|
void initializeCodeGen(PassRegistry&);
|
|
|
|
|
2010-10-07 20:50:11 +02:00
|
|
|
/// initializeCodeGen - Initialize all passes linked into the CodeGen library.
|
|
|
|
void initializeTarget(PassRegistry&);
|
|
|
|
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeAAEvalPass(PassRegistry&);
|
|
|
|
void initializeADCEPass(PassRegistry&);
|
|
|
|
void initializeAliasAnalysisAnalysisGroup(PassRegistry&);
|
|
|
|
void initializeAliasAnalysisCounterPass(PassRegistry&);
|
|
|
|
void initializeAliasDebuggerPass(PassRegistry&);
|
|
|
|
void initializeAliasSetPrinterPass(PassRegistry&);
|
|
|
|
void initializeAlwaysInlinerPass(PassRegistry&);
|
|
|
|
void initializeArgPromotionPass(PassRegistry&);
|
Introduce a BarrierNoop pass, a hack designed to allow *some* control
over the implicitly-formed-and-nesting CGSCC pass manager and function
pass managers, especially when using them on the opt commandline or
using extension points in the module builder. The '-barrier' opt flag
(or the pass itself) will create a no-op module pass in the pipeline,
resetting the pass manager stack, and allowing the creation of a new
pipeline of function passes or CGSCC passes to be created that is
independent from any previous pipelines.
For example, this can be used to test running two CGSCC passes in
independent CGSCC pass managers as opposed to in the same CGSCC pass
manager. It also allows us to introduce a further hack into the
PassManagerBuilder to separate the O0 pipeline extension passes from the
always-inliner's CGSCC pass manager, which they likely do not want to
participate in... At the very least none of the Sanitizer passes want
this behavior.
This fixes a bug with ASan at O0 currently, and I'll commit the ASan
test which covers this pass. I'm happy to add a test case that this pass
exists and works, but not sure how much time folks would like me to
spend adding test cases for the details of its behavior of partition
pass managers.... The whole thing is just vile, and mostly intended to
unblock ASan, so I'm hoping to rip this all out in a brave new pass
manager world.
llvm-svn: 166172
2012-10-18 10:05:46 +02:00
|
|
|
void initializeBarrierNoopPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeBasicAliasAnalysisPass(PassRegistry&);
|
|
|
|
void initializeBasicCallGraphPass(PassRegistry&);
|
|
|
|
void initializeBlockExtractorPassPass(PassRegistry&);
|
2011-07-25 21:25:40 +02:00
|
|
|
void initializeBlockFrequencyInfoPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeBlockPlacementPass(PassRegistry&);
|
2012-05-22 19:19:09 +02:00
|
|
|
void initializeBoundsCheckingPass(PassRegistry&);
|
2012-02-08 22:22:48 +01:00
|
|
|
void initializeBranchFolderPassPass(PassRegistry&);
|
2011-06-04 03:16:30 +02:00
|
|
|
void initializeBranchProbabilityInfoPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeBreakCriticalEdgesPass(PassRegistry&);
|
|
|
|
void initializeCFGOnlyPrinterPass(PassRegistry&);
|
|
|
|
void initializeCFGOnlyViewerPass(PassRegistry&);
|
|
|
|
void initializeCFGPrinterPass(PassRegistry&);
|
|
|
|
void initializeCFGSimplifyPassPass(PassRegistry&);
|
|
|
|
void initializeCFGViewerPass(PassRegistry&);
|
|
|
|
void initializeCalculateSpillWeightsPass(PassRegistry&);
|
|
|
|
void initializeCallGraphAnalysisGroup(PassRegistry&);
|
|
|
|
void initializeCodeGenPreparePass(PassRegistry&);
|
2012-02-08 22:23:13 +01:00
|
|
|
void initializeCodePlacementOptPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeConstantMergePass(PassRegistry&);
|
|
|
|
void initializeConstantPropagationPass(PassRegistry&);
|
2012-01-07 04:02:36 +01:00
|
|
|
void initializeMachineCopyPropagationPass(PassRegistry&);
|
2012-11-02 22:48:17 +01:00
|
|
|
void initializeCostModelAnalysisPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeCorrelatedValuePropagationPass(PassRegistry&);
|
|
|
|
void initializeDAEPass(PassRegistry&);
|
|
|
|
void initializeDAHPass(PassRegistry&);
|
|
|
|
void initializeDCEPass(PassRegistry&);
|
|
|
|
void initializeDSEPass(PassRegistry&);
|
|
|
|
void initializeDeadInstEliminationPass(PassRegistry&);
|
|
|
|
void initializeDeadMachineInstructionElimPass(PassRegistry&);
|
dependence analysis
Patch from Preston Briggs <preston.briggs@gmail.com>.
This is an updated version of the dependence-analysis patch, including an MIV
test based on Banerjee's inequalities.
It's a fairly complete implementation of the paper
Practical Dependence Testing
Gina Goff, Ken Kennedy, and Chau-Wen Tseng
PLDI 1991
It cannot yet propagate constraints between coupled RDIV subscripts (discussed
in Section 5.3.2 of the paper).
It's organized as a FunctionPass with a single entry point that supports testing
for dependence between two instructions in a function. If there's no dependence,
it returns null. If there's a dependence, it returns a pointer to a Dependence
which can be queried about details (what kind of dependence, is it loop
independent, direction and distance vector entries, etc). I haven't included
every imaginable feature, but there's a good selection that should be adequate
for supporting many loop transformations. Of course, it can be extended as
necessary.
Included in the patch file are many test cases, commented with C code showing
the loops and array references.
llvm-svn: 165708
2012-10-11 09:32:34 +02:00
|
|
|
void initializeDependenceAnalysisPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeDomOnlyPrinterPass(PassRegistry&);
|
|
|
|
void initializeDomOnlyViewerPass(PassRegistry&);
|
|
|
|
void initializeDomPrinterPass(PassRegistry&);
|
|
|
|
void initializeDomViewerPass(PassRegistry&);
|
|
|
|
void initializeDominanceFrontierPass(PassRegistry&);
|
|
|
|
void initializeDominatorTreePass(PassRegistry&);
|
2012-07-04 02:09:54 +02:00
|
|
|
void initializeEarlyIfConverterPass(PassRegistry&);
|
2011-01-04 22:10:05 +01:00
|
|
|
void initializeEdgeBundlesPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeEdgeProfilerPass(PassRegistry&);
|
2012-02-08 22:23:13 +01:00
|
|
|
void initializeExpandPostRAPass(PassRegistry&);
|
2011-01-29 02:09:53 +01:00
|
|
|
void initializePathProfilerPass(PassRegistry&);
|
2011-04-16 03:20:23 +02:00
|
|
|
void initializeGCOVProfilerPass(PassRegistry&);
|
2011-11-16 02:35:23 +01:00
|
|
|
void initializeAddressSanitizerPass(PassRegistry&);
|
2012-11-28 11:31:36 +01:00
|
|
|
void initializeAddressSanitizerModulePass(PassRegistry&);
|
2012-11-29 10:57:20 +01:00
|
|
|
void initializeMemorySanitizerPass(PassRegistry&);
|
2012-02-13 23:50:51 +01:00
|
|
|
void initializeThreadSanitizerPass(PassRegistry&);
|
2011-01-02 22:47:05 +01:00
|
|
|
void initializeEarlyCSEPass(PassRegistry&);
|
2010-11-18 19:45:06 +01:00
|
|
|
void initializeExpandISelPseudosPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeFindUsedTypesPass(PassRegistry&);
|
|
|
|
void initializeFunctionAttrsPass(PassRegistry&);
|
2012-02-08 22:23:13 +01:00
|
|
|
void initializeGCInfoDeleterPass(PassRegistry&);
|
|
|
|
void initializeGCMachineCodeAnalysisPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeGCModuleInfoPass(PassRegistry&);
|
|
|
|
void initializeGVNPass(PassRegistry&);
|
|
|
|
void initializeGlobalDCEPass(PassRegistry&);
|
|
|
|
void initializeGlobalOptPass(PassRegistry&);
|
|
|
|
void initializeGlobalsModRefPass(PassRegistry&);
|
|
|
|
void initializeIPCPPass(PassRegistry&);
|
|
|
|
void initializeIPSCCPPass(PassRegistry&);
|
|
|
|
void initializeIVUsersPass(PassRegistry&);
|
|
|
|
void initializeIfConverterPass(PassRegistry&);
|
|
|
|
void initializeIndVarSimplifyPass(PassRegistry&);
|
|
|
|
void initializeInstCombinerPass(PassRegistry&);
|
|
|
|
void initializeInstCountPass(PassRegistry&);
|
|
|
|
void initializeInstNamerPass(PassRegistry&);
|
|
|
|
void initializeInternalizePassPass(PassRegistry&);
|
|
|
|
void initializeIntervalPartitionPass(PassRegistry&);
|
|
|
|
void initializeJumpThreadingPass(PassRegistry&);
|
|
|
|
void initializeLCSSAPass(PassRegistry&);
|
|
|
|
void initializeLICMPass(PassRegistry&);
|
|
|
|
void initializeLazyValueInfoPass(PassRegistry&);
|
|
|
|
void initializeLibCallAliasAnalysisPass(PassRegistry&);
|
|
|
|
void initializeLintPass(PassRegistry&);
|
2010-11-30 03:17:10 +01:00
|
|
|
void initializeLiveDebugVariablesPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLiveIntervalsPass(PassRegistry&);
|
2012-06-09 04:13:10 +02:00
|
|
|
void initializeLiveRegMatrixPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLiveStacksPass(PassRegistry&);
|
|
|
|
void initializeLiveVariablesPass(PassRegistry&);
|
|
|
|
void initializeLoaderPassPass(PassRegistry&);
|
2012-08-29 00:21:25 +02:00
|
|
|
void initializeProfileMetadataLoaderPassPass(PassRegistry&);
|
2011-01-29 02:09:53 +01:00
|
|
|
void initializePathProfileLoaderPassPass(PassRegistry&);
|
2012-02-08 22:23:13 +01:00
|
|
|
void initializeLocalStackSlotPassPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLoopDeletionPass(PassRegistry&);
|
|
|
|
void initializeLoopExtractorPass(PassRegistry&);
|
|
|
|
void initializeLoopInfoPass(PassRegistry&);
|
2011-01-03 01:25:16 +01:00
|
|
|
void initializeLoopInstSimplifyPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLoopRotatePass(PassRegistry&);
|
|
|
|
void initializeLoopSimplifyPass(PassRegistry&);
|
|
|
|
void initializeLoopStrengthReducePass(PassRegistry&);
|
2011-10-17 19:17:43 +02:00
|
|
|
void initializeGlobalMergePass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLoopUnrollPass(PassRegistry&);
|
|
|
|
void initializeLoopUnswitchPass(PassRegistry&);
|
2010-12-26 20:32:44 +01:00
|
|
|
void initializeLoopIdiomRecognizePass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLowerAtomicPass(PassRegistry&);
|
2011-07-06 20:22:43 +02:00
|
|
|
void initializeLowerExpectIntrinsicPass(PassRegistry&);
|
2010-10-19 19:21:58 +02:00
|
|
|
void initializeLowerIntrinsicsPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeLowerInvokePass(PassRegistry&);
|
|
|
|
void initializeLowerSwitchPass(PassRegistry&);
|
2011-07-25 21:25:40 +02:00
|
|
|
void initializeMachineBlockFrequencyInfoPass(PassRegistry&);
|
Implement a block placement pass based on the branch probability and
block frequency analyses. This differs substantially from the existing
block-placement pass in LLVM:
1) It operates on the Machine-IR in the CodeGen layer. This exposes much
more (and more precise) information and opportunities. Also, the
results are more stable due to fewer transforms ocurring after the
pass runs.
2) It uses the generalized probability and frequency analyses. These can
model static heuristics, code annotation derived heuristics as well
as eventual profile loading. By basing the optimization on the
analysis interface it can work from any (or a combination) of these
inputs.
3) It uses a more aggressive algorithm, both building chains from tho
bottom up to maximize benefit, and using an SCC-based walk to layout
chains of blocks in a profitable ordering without O(N^2) iterations
which the old pass involves.
The pass is currently gated behind a flag, and not enabled by default
because it still needs to grow some important features. Most notably, it
needs to support loop aligning and careful layout of loop structures
much as done by hand currently in CodePlacementOpt. Once it supports
these, and has sufficient testing and quality tuning, it should replace
both of these passes.
Thanks to Nick Lewycky and Richard Smith for help authoring & debugging
this, and to Jakob, Andy, Eric, Jim, and probably a few others I'm
forgetting for reviewing and answering all my questions. Writing
a backend pass is *sooo* much better now than it used to be. =D
llvm-svn: 142641
2011-10-21 08:46:38 +02:00
|
|
|
void initializeMachineBlockPlacementPass(PassRegistry&);
|
2011-11-02 08:17:12 +01:00
|
|
|
void initializeMachineBlockPlacementStatsPass(PassRegistry&);
|
2011-06-16 22:22:37 +02:00
|
|
|
void initializeMachineBranchProbabilityInfoPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeMachineCSEPass(PassRegistry&);
|
|
|
|
void initializeMachineDominatorTreePass(PassRegistry&);
|
2012-09-17 16:08:37 +02:00
|
|
|
void initializeMachinePostDominatorTreePass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeMachineLICMPass(PassRegistry&);
|
|
|
|
void initializeMachineLoopInfoPass(PassRegistry&);
|
|
|
|
void initializeMachineModuleInfoPass(PassRegistry&);
|
2012-01-17 07:55:03 +01:00
|
|
|
void initializeMachineSchedulerPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeMachineSinkingPass(PassRegistry&);
|
2012-07-26 20:38:11 +02:00
|
|
|
void initializeMachineTraceMetricsPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeMachineVerifierPassPass(PassRegistry&);
|
|
|
|
void initializeMemCpyOptPass(PassRegistry&);
|
|
|
|
void initializeMemDepPrinterPass(PassRegistry&);
|
|
|
|
void initializeMemoryDependenceAnalysisPass(PassRegistry&);
|
2012-09-11 04:46:18 +02:00
|
|
|
void initializeMetaRenamerPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeMergeFunctionsPass(PassRegistry&);
|
|
|
|
void initializeModuleDebugInfoPrinterPass(PassRegistry&);
|
|
|
|
void initializeNoAAPass(PassRegistry&);
|
|
|
|
void initializeNoProfileInfoPass(PassRegistry&);
|
2011-01-29 02:09:53 +01:00
|
|
|
void initializeNoPathProfileInfoPass(PassRegistry&);
|
2011-06-16 01:37:01 +02:00
|
|
|
void initializeObjCARCAliasAnalysisPass(PassRegistry&);
|
2012-01-17 21:52:24 +01:00
|
|
|
void initializeObjCARCAPElimPass(PassRegistry&);
|
2011-06-16 01:37:01 +02:00
|
|
|
void initializeObjCARCExpandPass(PassRegistry&);
|
|
|
|
void initializeObjCARCContractPass(PassRegistry&);
|
|
|
|
void initializeObjCARCOptPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeOptimalEdgeProfilerPass(PassRegistry&);
|
|
|
|
void initializeOptimizePHIsPass(PassRegistry&);
|
|
|
|
void initializePEIPass(PassRegistry&);
|
|
|
|
void initializePHIEliminationPass(PassRegistry&);
|
|
|
|
void initializePartialInlinerPass(PassRegistry&);
|
|
|
|
void initializePeepholeOptimizerPass(PassRegistry&);
|
|
|
|
void initializePostDomOnlyPrinterPass(PassRegistry&);
|
|
|
|
void initializePostDomOnlyViewerPass(PassRegistry&);
|
|
|
|
void initializePostDomPrinterPass(PassRegistry&);
|
|
|
|
void initializePostDomViewerPass(PassRegistry&);
|
|
|
|
void initializePostDominatorTreePass(PassRegistry&);
|
2012-02-08 22:23:13 +01:00
|
|
|
void initializePostRASchedulerPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializePreVerifierPass(PassRegistry&);
|
|
|
|
void initializePrintDbgInfoPass(PassRegistry&);
|
|
|
|
void initializePrintFunctionPassPass(PassRegistry&);
|
|
|
|
void initializePrintModulePassPass(PassRegistry&);
|
|
|
|
void initializeProcessImplicitDefsPass(PassRegistry&);
|
|
|
|
void initializeProfileEstimatorPassPass(PassRegistry&);
|
|
|
|
void initializeProfileInfoAnalysisGroup(PassRegistry&);
|
2011-01-29 02:09:53 +01:00
|
|
|
void initializePathProfileInfoAnalysisGroup(PassRegistry&);
|
|
|
|
void initializePathProfileVerifierPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeProfileVerifierPassPass(PassRegistry&);
|
|
|
|
void initializePromotePassPass(PassRegistry&);
|
|
|
|
void initializePruneEHPass(PassRegistry&);
|
|
|
|
void initializeReassociatePass(PassRegistry&);
|
|
|
|
void initializeRegToMemPass(PassRegistry&);
|
|
|
|
void initializeRegionInfoPass(PassRegistry&);
|
|
|
|
void initializeRegionOnlyPrinterPass(PassRegistry&);
|
|
|
|
void initializeRegionOnlyViewerPass(PassRegistry&);
|
|
|
|
void initializeRegionPrinterPass(PassRegistry&);
|
|
|
|
void initializeRegionViewerPass(PassRegistry&);
|
|
|
|
void initializeSCCPPass(PassRegistry&);
|
Introduce a new SROA implementation.
This is essentially a ground up re-think of the SROA pass in LLVM. It
was initially inspired by a few problems with the existing pass:
- It is subject to the bane of my existence in optimizations: arbitrary
thresholds.
- It is overly conservative about which constructs can be split and
promoted.
- The vector value replacement aspect is separated from the splitting
logic, missing many opportunities where splitting and vector value
formation can work together.
- The splitting is entirely based around the underlying type of the
alloca, despite this type often having little to do with the reality
of how that memory is used. This is especially prevelant with unions
and base classes where we tail-pack derived members.
- When splitting fails (often due to the thresholds), the vector value
replacement (again because it is separate) can kick in for
preposterous cases where we simply should have split the value. This
results in forming i1024 and i2048 integer "bit vectors" that
tremendously slow down subsequnet IR optimizations (due to large
APInts) and impede the backend's lowering.
The new design takes an approach that fundamentally is not susceptible
to many of these problems. It is the result of a discusison between
myself and Duncan Sands over IRC about how to premptively avoid these
types of problems and how to do SROA in a more principled way. Since
then, it has evolved and grown, but this remains an important aspect: it
fixes real world problems with the SROA process today.
First, the transform of SROA actually has little to do with replacement.
It has more to do with splitting. The goal is to take an aggregate
alloca and form a composition of scalar allocas which can replace it and
will be most suitable to the eventual replacement by scalar SSA values.
The actual replacement is performed by mem2reg (and in the future
SSAUpdater).
The splitting is divided into four phases. The first phase is an
analysis of the uses of the alloca. This phase recursively walks uses,
building up a dense datastructure representing the ranges of the
alloca's memory actually used and checking for uses which inhibit any
aspects of the transform such as the escape of a pointer.
Once we have a mapping of the ranges of the alloca used by individual
operations, we compute a partitioning of the used ranges. Some uses are
inherently splittable (such as memcpy and memset), while scalar uses are
not splittable. The goal is to build a partitioning that has the minimum
number of splits while placing each unsplittable use in its own
partition. Overlapping unsplittable uses belong to the same partition.
This is the target split of the aggregate alloca, and it maximizes the
number of scalar accesses which become accesses to their own alloca and
candidates for promotion.
Third, we re-walk the uses of the alloca and assign each specific memory
access to all the partitions touched so that we have dense use-lists for
each partition.
Finally, we build a new, smaller alloca for each partition and rewrite
each use of that partition to use the new alloca. During this phase the
pass will also work very hard to transform uses of an alloca into a form
suitable for promotion, including forming vector operations, speculating
loads throguh PHI nodes and selects, etc.
After splitting is complete, each newly refined alloca that is
a candidate for promotion to a scalar SSA value is run through mem2reg.
There are lots of reasonably detailed comments in the source code about
the design and algorithms, and I'm going to be trying to improve them in
subsequent commits to ensure this is well documented, as the new pass is
in many ways more complex than the old one.
Some of this is still a WIP, but the current state is reasonbly stable.
It has passed bootstrap, the nightly test suite, and Duncan has run it
successfully through the ACATS and DragonEgg test suites. That said, it
remains behind a default-off flag until the last few pieces are in
place, and full testing can be done.
Specific areas I'm looking at next:
- Improved comments and some code cleanup from reviews.
- SSAUpdater and enabling this pass inside the CGSCC pass manager.
- Some datastructure tuning and compile-time measurements.
- More aggressive FCA splitting and vector formation.
Many thanks to Duncan Sands for the thorough final review, as well as
Benjamin Kramer for lots of review during the process of writing this
pass, and Daniel Berlin for reviewing the data structures and algorithms
and general theory of the pass. Also, several other people on IRC, over
lunch tables, etc for lots of feedback and advice.
llvm-svn: 163883
2012-09-14 11:22:59 +02:00
|
|
|
void initializeSROAPass(PassRegistry&);
|
2011-01-18 04:53:26 +01:00
|
|
|
void initializeSROA_DTPass(PassRegistry&);
|
2011-01-14 09:13:00 +01:00
|
|
|
void initializeSROA_SSAUpPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeScalarEvolutionAliasAnalysisPass(PassRegistry&);
|
|
|
|
void initializeScalarEvolutionPass(PassRegistry&);
|
|
|
|
void initializeSimpleInlinerPass(PassRegistry&);
|
2011-06-27 00:34:10 +02:00
|
|
|
void initializeRegisterCoalescerPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeSimplifyLibCallsPass(PassRegistry&);
|
|
|
|
void initializeSingleLoopExtractorPass(PassRegistry&);
|
|
|
|
void initializeSinkingPass(PassRegistry&);
|
|
|
|
void initializeSlotIndexesPass(PassRegistry&);
|
2011-01-06 02:21:53 +01:00
|
|
|
void initializeSpillPlacementPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeStackProtectorPass(PassRegistry&);
|
2012-09-06 11:17:37 +02:00
|
|
|
void initializeStackColoringPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeStackSlotColoringPass(PassRegistry&);
|
|
|
|
void initializeStripDeadDebugInfoPass(PassRegistry&);
|
|
|
|
void initializeStripDeadPrototypesPassPass(PassRegistry&);
|
|
|
|
void initializeStripDebugDeclarePass(PassRegistry&);
|
|
|
|
void initializeStripNonDebugSymbolsPass(PassRegistry&);
|
|
|
|
void initializeStripSymbolsPass(PassRegistry&);
|
|
|
|
void initializeStrongPHIEliminationPass(PassRegistry&);
|
|
|
|
void initializeTailCallElimPass(PassRegistry&);
|
2012-02-08 22:23:13 +01:00
|
|
|
void initializeTailDuplicatePassPass(PassRegistry&);
|
2012-02-04 03:56:45 +01:00
|
|
|
void initializeTargetPassConfigPass(PassRegistry&);
|
2012-10-05 01:01:22 +02:00
|
|
|
void initializeDataLayoutPass(PassRegistry&);
|
2012-10-19 01:22:48 +02:00
|
|
|
void initializeTargetTransformInfoPass(PassRegistry&);
|
2011-02-18 22:50:34 +01:00
|
|
|
void initializeTargetLibraryInfoPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
void initializeTwoAddressInstructionPassPass(PassRegistry&);
|
|
|
|
void initializeTypeBasedAliasAnalysisPass(PassRegistry&);
|
|
|
|
void initializeUnifyFunctionExitNodesPass(PassRegistry&);
|
|
|
|
void initializeUnreachableBlockElimPass(PassRegistry&);
|
|
|
|
void initializeUnreachableMachineBlockElimPass(PassRegistry&);
|
|
|
|
void initializeVerifierPass(PassRegistry&);
|
|
|
|
void initializeVirtRegMapPass(PassRegistry&);
|
2012-06-09 01:44:45 +02:00
|
|
|
void initializeVirtRegRewriterPass(PassRegistry&);
|
2010-12-20 21:54:37 +01:00
|
|
|
void initializeInstSimplifierPass(PassRegistry&);
|
2011-12-14 03:11:42 +01:00
|
|
|
void initializeUnpackMachineBundlesPass(PassRegistry&);
|
2012-01-19 08:47:03 +01:00
|
|
|
void initializeFinalizeMachineBundlesPass(PassRegistry&);
|
2012-10-17 20:25:06 +02:00
|
|
|
void initializeLoopVectorizePass(PassRegistry&);
|
2012-02-01 04:51:43 +01:00
|
|
|
void initializeBBVectorizePass(PassRegistry&);
|
2012-05-30 02:17:12 +02:00
|
|
|
void initializeMachineFunctionPrinterPassPass(PassRegistry&);
|
2010-10-07 06:17:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|