25 return this->runOnModule(
P, M,
true);
27 return this->runOnFunction(
P,
F,
true);
32 runAfterPassModule(
P, M);
34 runAfterPassFunction(
P,
F);
38void DroppedVariableStatsIR::runAfterPassFunction(
StringRef PassID,
41 calculateDroppedVarStatsOnFunction(
F, PassID,
F->getName().str(),
"Function");
44void DroppedVariableStatsIR::runAfterPassModule(
StringRef PassID,
46 runOnModule(PassID, M,
false);
47 calculateDroppedVarStatsOnModule(M, PassID, M->getName().str(),
"Module");
53 auto FuncName =
F->getName();
58void DroppedVariableStatsIR::calculateDroppedVarStatsOnFunction(
62 StringRef FuncName =
F->getName();
68void DroppedVariableStatsIR::runOnModule(
StringRef PassID,
const Module *M,
71 runOnFunction(PassID, &
F, Before);
75void DroppedVariableStatsIR::calculateDroppedVarStatsOnModule(
79 calculateDroppedVarStatsOnFunction(&
F, PassID, FuncOrModName, PassLevel);
88 PIC.registerBeforeNonSkippedPassCallback(
90 PIC.registerAfterPassCallback(
94 PIC.registerAfterPassInvalidatedCallback(
98void DroppedVariableStatsIR::visitEveryInstruction(
101 const DIScope *DbgValScope = std::get<0>(Var);
103 auto *DbgLoc =
I.getDebugLoc().get();
107 InlinedAtsMap, Var, DroppedCount))
112void DroppedVariableStatsIR::visitEveryDebugRecord(
117 for (DbgRecord &DR :
I.getDbgRecordRange()) {
119 auto *DbgVar =
Dbg->getVariable();
120 auto DbgLoc = DR.getDebugLoc();
Expand Atomic instructions
===- DroppedVariableStatsIR.h - Opt Diagnostics -*- C++ -*-----------—===//
static bool runOnFunction(Function &F, bool PostInlining)
Module.h This file contains the declarations for the Module class.
Legalize the Machine IR a function s Machine IR
PassInstrumentationCallbacks PIC
This file defines the Pass Instrumentation classes that provide instrumentation points into the pass ...
Base class for scope-like contexts.
Implements a dense probed hash-table based set.
void registerCallbacks(PassInstrumentationCallbacks &PIC)
void runAfterPass(StringRef P, IRUnitRef IR)
void runBeforePass(StringRef P, IRUnitRef IR)
LLVM_ABI void calculateDroppedStatsAndPrint(DebugVariables &DbgVariables, StringRef FuncName, StringRef PassID, StringRef FuncOrModName, StringRef PassLevel, const Function *Func)
Calculate the number of dropped variables in an llvm::Function or llvm::MachineFunction and print the...
LLVM_ABI bool updateDroppedCount(DILocation *DbgLoc, const DIScope *Scope, const DIScope *DbgValScope, DenseMap< VarID, DILocation * > &InlinedAtsMap, VarID Var, unsigned &DroppedCount)
Check if a Var has been dropped or is a false positive.
bool DroppedVariableStatsEnabled
LLVM_ABI void populateVarIDSetAndInlinedMap(const DILocalVariable *DbgVar, DebugLoc DbgLoc, DenseSet< VarID > &VarIDSet, DenseMap< StringRef, DenseMap< VarID, DILocation * > > &InlinedAtsMap, StringRef FuncName, bool Before)
Populate the VarIDSet and InlinedAtMap with the relevant information needed for before and after pass...
SmallVector< DenseMap< const Function *, DebugVariables > > DebugVariablesStack
A stack of a DenseMap, that maps DebugVariables for every pass to an llvm::Function.
LLVM_ABI void run(DebugVariables &DbgVariables, StringRef FuncName, bool Before)
Run code to populate relevant data structures over an llvm::Function or llvm::MachineFunction.
A type-erased reference to the IR unit a pass or analysis is running on, together with the kind of IR...
A Module instance is used to store all the information related to an LLVM module.
This class manages callbacks registration, as well as provides a way for PassInstrumentation to pass ...
A set of analyses that are preserved following a run of a transformation pass.
Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.
std::tuple< const DIScope *, const DIScope *, const DILocalVariable * > VarID
A unique key that represents a debug variable.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.