LLVM
24.0.0git
include
llvm
IR
DroppedVariableStatsIR.h
Go to the documentation of this file.
1
///===- DroppedVariableStatsIR.h - Opt Diagnostics -*- C++ -*--------------===//
2
///
3
/// Part of the LLVM Project, under the Apache License v2.0 with LLVM
4
/// Exceptions. See https://llvm.org/LICENSE.txt for license information.
5
/// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
///
7
///===---------------------------------------------------------------------===//
8
/// \file
9
/// Dropped Variable Statistics for Debug Information. Reports any number
10
/// of #dbg_value that get dropped due to an optimization pass.
11
///
12
///===---------------------------------------------------------------------===//
13
14
#ifndef LLVM_CODEGEN_DROPPEDVARIABLESTATSIR_H
15
#define LLVM_CODEGEN_DROPPEDVARIABLESTATSIR_H
16
17
#include "
llvm/IR/DroppedVariableStats.h
"
18
#include "
llvm/IR/IRUnitRef.h
"
19
#include "
llvm/Support/Compiler.h
"
20
21
namespace
llvm
{
22
23
class
StringRef
;
24
class
PassInstrumentationCallbacks
;
25
class
Function
;
26
class
Module
;
27
28
/// A class to collect and print dropped debug information due to LLVM IR
29
/// optimization passes. After every LLVM IR pass is run, it will print how many
30
/// #dbg_values were dropped due to that pass.
31
class
LLVM_ABI
DroppedVariableStatsIR
:
public
DroppedVariableStats
{
32
public
:
33
DroppedVariableStatsIR
(
bool
DroppedVarStatsEnabled)
34
:
llvm
::
DroppedVariableStats
(DroppedVarStatsEnabled) {}
35
36
void
runBeforePass(
StringRef
P
,
IRUnitRef
IR
);
37
38
void
runAfterPass(
StringRef
P
,
IRUnitRef
IR
);
39
40
void
registerCallbacks
(
PassInstrumentationCallbacks
&
PIC
);
41
42
private
:
43
const
Function
*Func;
44
45
void
runAfterPassFunction(
StringRef
PassID
,
const
Function
*
F
);
46
47
void
runAfterPassModule(
StringRef
PassID
,
const
Module
*M);
48
49
/// Populate DebugVariablesBefore or DebugVariablesAfter before or after a
50
/// pass has run to facilitate dropped variable calculation for an
51
/// llvm::Function.
52
void
runOnFunction
(
StringRef
PassID
,
const
Function
*
F
,
bool
Before);
53
54
/// Iterate over all Instructions in a Function and report any dropped debug
55
/// information.
56
void
calculateDroppedVarStatsOnFunction(
const
Function
*
F
,
StringRef
PassID
,
57
StringRef
FuncOrModName,
58
StringRef
PassLevel);
59
60
/// Populate DebugVariablesBefore or DebugVariablesAfter before or after a
61
/// pass has run to facilitate dropped variable calculation for an
62
/// llvm::Module. Calls runOnFunction on every Function in the Module.
63
void
runOnModule(
StringRef
PassID
,
const
Module
*M,
bool
Before);
64
65
/// Iterate over all Functions in a Module and report any dropped debug
66
/// information. Will call calculateDroppedVarStatsOnFunction on every
67
/// Function.
68
void
calculateDroppedVarStatsOnModule(
const
Module
*M,
StringRef
PassID
,
69
StringRef
FuncOrModName,
70
StringRef
PassLevel);
71
72
/// Override base class method to run on an llvm::Function specifically.
73
void
visitEveryInstruction(
unsigned
&DroppedCount,
VarID
Var)
override
;
74
75
/// Override base class method to run on #dbg_values specifically.
76
void
visitEveryDebugRecord(
DenseSet<VarID>
&VarIDSet)
override
;
77
};
78
79
}
// namespace llvm
80
81
#endif
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:211
DroppedVariableStats.h
===- DroppedVariableStats.h - Opt Diagnostics -*- C++ -*-------------—===//
runOnFunction
static bool runOnFunction(Function &F, bool PostInlining)
Definition
EntryExitInstrumenter.cpp:109
IRUnitRef.h
This file defines IRUnitRef, a type-erased reference to the IR unit a pass or analysis is running on,...
IR
Legalize the Machine IR a function s Machine IR
Definition
Legalizer.cpp:85
F
#define F(x, y, z)
Definition
MD5.cpp:54
P
#define P(N)
registerCallbacks
SI registerCallbacks(PIC, &MAM)
PIC
PassInstrumentationCallbacks PIC
Definition
PassBuilderBindings.cpp:57
PassID
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition
DenseSet.h:283
llvm::DroppedVariableStatsIR::DroppedVariableStatsIR
DroppedVariableStatsIR(bool DroppedVarStatsEnabled)
Definition
DroppedVariableStatsIR.h:33
llvm::DroppedVariableStats::DroppedVariableStats
LLVM_ABI DroppedVariableStats(bool DroppedVarStatsEnabled)
Definition
DroppedVariableStats.cpp:21
llvm::Function
Definition
Function.h:65
llvm::IRUnitRef
A type-erased reference to the IR unit a pass or analysis is running on, together with the kind of IR...
Definition
IRUnitRef.h:60
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition
Module.h:68
llvm::PassInstrumentationCallbacks
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
Definition
PassInstrumentation.h:67
llvm::StringRef
Represent a constant reference to a string, i.e.
Definition
StringRef.h:56
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
DefaultTargetInfo.h:21
llvm::VarID
DebugVariableAggregate VarID
A unique key that represents one instance of a debug variable.
Definition
DroppedVariableStats.h:29
Generated on
for LLVM by
1.14.0