Go to the documentation of this file.
63 bool runOnModule(
Module &M)
override {
68 return this->getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
F);
72 this->getAnalysis<DominatorTreeWrapperPass>(
F).getDomTree();
74 std::make_unique<PredicateInfo>(
76 this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
97 "Interprocedural Sparse Conditional Constant Propagation",
124 return {std::make_unique<PredicateInfo>(
140 struct FunctionSpecializationLegacyPass :
public ModulePass {
151 virtual bool runOnModule(
Module &M)
override {
157 return this->getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(
F);
160 return this->getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
F);
163 return this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
F);
168 this->getAnalysis<DominatorTreeWrapperPass>(
F).getDomTree();
170 std::make_unique<PredicateInfo>(
172 this->getAnalysis<AssumptionCacheTracker>().getAssumptionCache(
185 FunctionSpecializationLegacyPass,
"function-specialization",
186 "Propagate constant arguments by specializing the function",
false,
false)
197 return new FunctionSpecializationLegacyPass();
A set of analyses that are preserved following a run of a transformation pass.
Analysis pass providing the TargetTransformInfo.
we should consider alternate ways to model stack dependencies Lots of things could be done in WebAssemblyTargetTransformInfo cpp there are numerous optimization related hooks that can be overridden in WebAssemblyTargetLowering Instead of the OptimizeReturned which should consider preserving the returned attribute through to MachineInstrs and extending the MemIntrinsicResults pass to do this optimization on calls too That would also let the WebAssemblyPeephole pass clean up dead defs for such as it does for stores Consider implementing and or getMachineCombinerPatterns Find a clean way to fix the problem which leads to the Shrink Wrapping pass being run after the WebAssembly PEI pass When setting multiple variables to the same constant
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
A parsed version of the target data layout string in and methods for querying it.
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Helper struct for bundling up the analysis results per function for IPSCCP.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
function Propagate constant arguments by specializing the function
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
FunctionAnalysisManager FAM
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
INITIALIZE_PASS_BEGIN(IPSCCPLegacyPass, "ipsccp", "Interprocedural Sparse Conditional Constant Propagation", false, false) INITIALIZE_PASS_END(IPSCCPLegacyPass
Represent the analysis usage information of a pass.
Interprocedural Sparse Conditional Constant Propagation
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Legacy analysis pass which computes a DominatorTree.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
bool runIPSCCP(Module &M, const DataLayout &DL, std::function< const TargetLibraryInfo &(Function &)> GetTLI, function_ref< AnalysisResultsForFn(Function &)> getAnalysis)
ModulePass * createIPSCCPPass()
createIPSCCPPass - This pass propagates constants from call sites into the bodies of functions,...
This is an important base class in LLVM.
A function analysis which provides an AssumptionCache.
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
void preserve()
Mark an analysis as preserved.
A Module instance is used to store all the information related to an LLVM module.
bool runFunctionSpecialization(Module &M, const DataLayout &DL, std::function< TargetLibraryInfo &(Function &)> GetTLI, std::function< TargetTransformInfo &(Function &)> GetTTI, std::function< AssumptionCache &(Function &)> GetAC, function_ref< AnalysisResultsForFn(Function &)> GetAnalysis)
An immutable pass that tracks lazily created AssumptionCache objects.
A cache of @llvm.assume calls within a function.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PassT::Result * getCachedResult(IRUnitT &IR) const
Get the cached result of an analysis pass for a given IR unit.
Provides information about what library functions are available for the current target.
we compile this esp call L1 $pb L1 esp je LBB1_2 esp ret but is currently always computed in the entry block It would be better to sink the picbase computation down into the block for the as it is the only one that uses it This happens for a lot of code with early outs Another example is loads of arguments
Analysis pass which computes a DominatorTree.
A container for analyses that lazily runs them and caches their results.
An analysis over an "outer" IR unit that provides access to an analysis manager over an "inner" IR un...
Analysis pass which computes a PostDominatorTree.
AnalysisUsage & addRequired()
void initializeIPSCCPLegacyPassPass(PassRegistry &)
ModulePass * createFunctionSpecializationPass()
createFunctionSpecializationPass - This pass propagates constants from call sites to the specialized ...
Analysis pass providing the TargetLibraryInfo.