Changeset View
Changeset View
Standalone View
Standalone View
include/llvm/Transforms/Instrumentation.h
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | struct GCOVOptions { | ||||
// Emit the exit block immediately after the start block, rather than after | // Emit the exit block immediately after the start block, rather than after | ||||
// all of the function body's blocks. | // all of the function body's blocks. | ||||
bool ExitBlockBeforeBody; | bool ExitBlockBeforeBody; | ||||
}; | }; | ||||
ModulePass *createGCOVProfilerPass(const GCOVOptions &Options = | ModulePass *createGCOVProfilerPass(const GCOVOptions &Options = | ||||
GCOVOptions::getDefault()); | GCOVOptions::getDefault()); | ||||
// PGO Instrumention | |||||
ModulePass *createPGOInstrumentationGenPass(); | |||||
ModulePass * | |||||
createPGOInstrumentationUsePass(StringRef Filename = StringRef("")); | |||||
/// Options for the frontend instrumentation based profiling pass. | /// Options for the frontend instrumentation based profiling pass. | ||||
struct InstrProfOptions { | struct InstrProfOptions { | ||||
InstrProfOptions() : NoRedZone(false) {} | InstrProfOptions() : NoRedZone(false) {} | ||||
// Add the 'noredzone' attribute to added runtime library calls. | // Add the 'noredzone' attribute to added runtime library calls. | ||||
bool NoRedZone; | bool NoRedZone; | ||||
// Name of the profile file to use as output | // Name of the profile file to use as output | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
// BoundsChecking - This pass instruments the code to perform run-time bounds | // BoundsChecking - This pass instruments the code to perform run-time bounds | ||||
// checking on loads, stores, and other memory intrinsics. | // checking on loads, stores, and other memory intrinsics. | ||||
FunctionPass *createBoundsCheckingPass(); | FunctionPass *createBoundsCheckingPass(); | ||||
/// \brief This pass splits the stack into a safe stack and an unsafe stack to | /// \brief This pass splits the stack into a safe stack and an unsafe stack to | ||||
/// protect against stack-based overflow vulnerabilities. | /// protect against stack-based overflow vulnerabilities. | ||||
FunctionPass *createSafeStackPass(const TargetMachine *TM = nullptr); | FunctionPass *createSafeStackPass(const TargetMachine *TM = nullptr); | ||||
/// \brief Calculate what to divide by to scale counts. | |||||
/// | |||||
/// Given the maximum count, calculate a divisor that will scale all the | |||||
/// weights to strictly less than UINT32_MAX. | |||||
static inline uint64_t calculateCountScale(uint64_t MaxCount) { | |||||
return MaxCount < UINT32_MAX ? 1 : MaxCount / UINT32_MAX + 1; | |||||
} | |||||
/// \brief Scale an individual branch count. | |||||
/// | |||||
/// Scale a 64-bit weight down to 32-bits using \c Scale. | |||||
/// | |||||
static inline uint32_t scaleBranchCount(uint64_t Count, uint64_t Scale) { | |||||
uint64_t Scaled = Count / Scale; | |||||
assert(Scaled <= UINT32_MAX && "overflow 32-bits"); | |||||
return Scaled; | |||||
} | |||||
} // End llvm namespace | } // End llvm namespace | ||||
#endif | #endif | ||||
silvas: http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators… | |||||
Use correct capitalization http://llvm.org/docs/CodingStandards.html#commenting silvas: Use correct capitalization http://llvm.org/docs/CodingStandards.html#commenting | |||||
An interface is available in ProfileData/InstrProf.h: llvm::getPGOFuncName which is also used by cfe. Remove this dup. davidxl: An interface is available in ProfileData/InstrProf.h:
llvm::getPGOFuncName
which is also used… | |||||
Similarly llvm::createPGOFuncNameVar will do what you need. Remove this duplicate. davidxl: Similarly llvm::createPGOFuncNameVar will do what you need.
Remove this duplicate. |
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
(here and elsewhere)