LLVM
8.0.1
include
llvm
Transforms
Scalar
SCCP.h
Go to the documentation of this file.
1
//===- SCCP.cpp - Sparse Conditional Constant Propagation -------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// \file
11
// This file implements sparse conditional constant propagation and merging:
12
//
13
// Specifically, this:
14
// * Assumes values are constant unless proven otherwise
15
// * Assumes BasicBlocks are dead unless proven otherwise
16
// * Proves values to be constant, and replaces them with constants
17
// * Proves conditional branches to be unconditional
18
//
19
//===----------------------------------------------------------------------===//
20
21
#ifndef LLVM_TRANSFORMS_SCALAR_SCCP_H
22
#define LLVM_TRANSFORMS_SCALAR_SCCP_H
23
24
#include "
llvm/ADT/STLExtras.h
"
25
#include "
llvm/Analysis/TargetLibraryInfo.h
"
26
#include "
llvm/IR/DataLayout.h
"
27
#include "
llvm/IR/Function.h
"
28
#include "
llvm/IR/Module.h
"
29
#include "
llvm/IR/PassManager.h
"
30
#include "
llvm/Transforms/Utils/PredicateInfo.h
"
31
32
namespace
llvm
{
33
34
class
PostDominatorTree;
35
36
/// This pass performs function-level constant propagation and merging.
37
class
SCCPPass
:
public
PassInfoMixin
<SCCPPass> {
38
public
:
39
PreservedAnalyses
run
(
Function
&
F
,
FunctionAnalysisManager
&AM);
40
};
41
42
/// Helper struct for bundling up the analysis results per function for IPSCCP.
43
struct
AnalysisResultsForFn
{
44
std::unique_ptr<PredicateInfo>
PredInfo
;
45
DominatorTree
*
DT
;
46
PostDominatorTree
*
PDT
;
47
};
48
49
bool
runIPSCCP
(
Module
&M,
const
DataLayout
&DL,
const
TargetLibraryInfo
*TLI,
50
function_ref
<
AnalysisResultsForFn
(
Function
&)> getAnalysis);
51
}
// end namespace llvm
52
53
#endif // LLVM_TRANSFORMS_SCALAR_SCCP_H
llvm::DataLayout
A parsed version of the target data layout string in and methods for querying it. ...
Definition:
DataLayout.h:111
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::Module
A Module instance is used to store all the information related to an LLVM module. ...
Definition:
Module.h:65
DataLayout.h
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition:
STLExtras.h:117
F
F(f)
llvm::Function
Definition:
Function.h:60
llvm::AnalysisResultsForFn::PredInfo
std::unique_ptr< PredicateInfo > PredInfo
Definition:
SCCP.h:44
llvm::SCCPPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition:
SCCP.cpp:1813
STLExtras.h
llvm::AnalysisResultsForFn
Helper struct for bundling up the analysis results per function for IPSCCP.
Definition:
SCCP.h:43
TargetLibraryInfo.h
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition:
PassManager.h:366
llvm::AnalysisResultsForFn::PDT
PostDominatorTree * PDT
Definition:
SCCP.h:46
llvm::DominatorTree
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
Definition:
Dominators.h:145
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition:
PassManager.h:154
PredicateInfo.h
This file implements the PredicateInfo analysis, which creates an Extended SSA form for operations us...
Module.h
Module.h This file contains the declarations for the Module class.
llvm::TargetLibraryInfo
Provides information about what library functions are available for the current target.
Definition:
TargetLibraryInfo.h:206
llvm::PostDominatorTree
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
Definition:
PostDominators.h:29
Function.h
llvm::AnalysisResultsForFn::DT
DominatorTree * DT
Definition:
SCCP.h:45
llvm::runIPSCCP
bool runIPSCCP(Module &M, const DataLayout &DL, const TargetLibraryInfo *TLI, function_ref< AnalysisResultsForFn(Function &)> getAnalysis)
Definition:
SCCP.cpp:1936
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:
InstructionSimplify.h:41
llvm::SCCPPass
This pass performs function-level constant propagation and merging.
Definition:
SCCP.h:37
PassManager.h
This header defines various interfaces for pass management in LLVM.
Generated on Sun Dec 20 2020 13:53:39 for LLVM by
1.8.13