Initialize CodeMetrics' member variables inline with definitions.

Summary: No functional changes.

Reviewers: jingyue

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17125

llvm-svn: 260727
This commit is contained in:
Justin Lebar 2016-02-12 20:59:20 +00:00
parent 9f77ef0c08
commit 531b24b53a
1 changed files with 10 additions and 15 deletions

View File

@ -42,50 +42,45 @@ bool callIsSmall(ImmutableCallSite CS);
struct CodeMetrics { struct CodeMetrics {
/// \brief True if this function contains a call to setjmp or other functions /// \brief True if this function contains a call to setjmp or other functions
/// with attribute "returns twice" without having the attribute itself. /// with attribute "returns twice" without having the attribute itself.
bool exposesReturnsTwice; bool exposesReturnsTwice = false;
/// \brief True if this function calls itself. /// \brief True if this function calls itself.
bool isRecursive; bool isRecursive = false;
/// \brief True if this function cannot be duplicated. /// \brief True if this function cannot be duplicated.
/// ///
/// True if this function contains one or more indirect branches, or it contains /// True if this function contains one or more indirect branches, or it contains
/// one or more 'noduplicate' instructions. /// one or more 'noduplicate' instructions.
bool notDuplicatable; bool notDuplicatable = false;
/// \brief True if this function calls alloca (in the C sense). /// \brief True if this function calls alloca (in the C sense).
bool usesDynamicAlloca; bool usesDynamicAlloca = false;
/// \brief Number of instructions in the analyzed blocks. /// \brief Number of instructions in the analyzed blocks.
unsigned NumInsts; unsigned NumInsts = false;
/// \brief Number of analyzed blocks. /// \brief Number of analyzed blocks.
unsigned NumBlocks; unsigned NumBlocks = false;
/// \brief Keeps track of basic block code size estimates. /// \brief Keeps track of basic block code size estimates.
DenseMap<const BasicBlock *, unsigned> NumBBInsts; DenseMap<const BasicBlock *, unsigned> NumBBInsts;
/// \brief Keep track of the number of calls to 'big' functions. /// \brief Keep track of the number of calls to 'big' functions.
unsigned NumCalls; unsigned NumCalls = false;
/// \brief The number of calls to internal functions with a single caller. /// \brief The number of calls to internal functions with a single caller.
/// ///
/// These are likely targets for future inlining, likely exposed by /// These are likely targets for future inlining, likely exposed by
/// interleaved devirtualization. /// interleaved devirtualization.
unsigned NumInlineCandidates; unsigned NumInlineCandidates = 0;
/// \brief How many instructions produce vector values. /// \brief How many instructions produce vector values.
/// ///
/// The inliner is more aggressive with inlining vector kernels. /// The inliner is more aggressive with inlining vector kernels.
unsigned NumVectorInsts; unsigned NumVectorInsts = 0;
/// \brief How many 'ret' instructions the blocks contain. /// \brief How many 'ret' instructions the blocks contain.
unsigned NumRets; unsigned NumRets = 0;
CodeMetrics()
: exposesReturnsTwice(false), isRecursive(false), notDuplicatable(false),
usesDynamicAlloca(false), NumInsts(0), NumBlocks(0), NumCalls(0),
NumInlineCandidates(0), NumVectorInsts(0), NumRets(0) {}
/// \brief Add information about a block to the current state. /// \brief Add information about a block to the current state.
void analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI, void analyzeBasicBlock(const BasicBlock *BB, const TargetTransformInfo &TTI,