#include "CodeGenPGO.h"
#include "CodeGenFunction.h"
#include "CoverageMappingGen.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MD5.h"
#include <optional>
Go to the source code of this file.
namespace llvm Diagnostic wrappers for TextAPI types for error reporting.bool Traverse##N(N *S) { \
Base::Traverse##N(S); \
Hash.combine(PGOHash::EndOfScope); \
return true; \
}
Definition at line 474 of file CodeGenPGO.cpp.
◆ PGOHashVersionThe version of the PGO hash algorithm.
Enumerator PGO_HASH_V1 PGO_HASH_V2 PGO_HASH_V3 PGO_HASH_LATESTDefinition at line 56 of file CodeGenPGO.cpp.
◆ calculateWeightScale() static uint64_t calculateWeightScale ( uint64_t MaxWeight ) staticCalculate what to divide by to scale weights.
Given the maximum weight, calculate a divisor that will scale all the weights to strictly less than UINT32_MAX.
Definition at line 1444 of file CodeGenPGO.cpp.
◆ EnableValueProfiling() ◆ scaleBranchWeight() static uint32_t scaleBranchWeight ( uint64_t Weight, uint64_t Scale ) staticScale an individual branch weight (and add 1).
Scale a 64-bit weight down to 32-bits using Scale
.
According to Laplace's Rule of Succession, it is better to compute the weight based on the count plus 1, so universally add 1 to the value.
Scale
was calculated by calculateWeightScale() with a weight no greater than Weight
.
Definition at line 1457 of file CodeGenPGO.cpp.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4