Skip to content

Commit e0ade45

Browse files
authored
[MemProf][NFC] Rename DefaultShadowGranularity to DefaultMemGranulari… (#79412)
…ty in instrumentation code, be consistent with runtime In runtime code, the size of memory block mapped to a single shadow location is called MEM_GRANULARITY. In instrumentation code, the size of memory block mapped to a single shadow location is called DefaultShadowGranularity. Actually, the SHADOW_GRANULARITY is 8 (1 << SHADOW_SCALE), and the MEM_GRANULARITY is 64. The wording of DefaultShadowGranularity in instrumentation code is a bit misleading, this patch renames DefaultShadowGranularity to DefaultMemGranularity, be consistent with runtime.
1 parent 4792f91 commit e0ade45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extern cl::opt<bool> NoPGOWarnMismatchComdatWeak;
5959
constexpr int LLVM_MEM_PROFILER_VERSION = 1;
6060

6161
// Size of memory mapped to a single shadow location.
62-
constexpr uint64_t DefaultShadowGranularity = 64;
62+
constexpr uint64_t DefaultMemGranularity = 64;
6363

6464
// Scale from granularity down to shadow size.
6565
constexpr uint64_t DefaultShadowScale = 3;
@@ -120,7 +120,7 @@ static cl::opt<int> ClMappingScale("memprof-mapping-scale",
120120
static cl::opt<int>
121121
ClMappingGranularity("memprof-mapping-granularity",
122122
cl::desc("granularity of memprof shadow mapping"),
123-
cl::Hidden, cl::init(DefaultShadowGranularity));
123+
cl::Hidden, cl::init(DefaultMemGranularity));
124124

125125
static cl::opt<bool> ClStack("memprof-instrument-stack",
126126
cl::desc("Instrument scalar stack variables"),

0 commit comments

Comments
 (0)