Skip to content

Commit 32dd0b7

Browse files
yichi170dvbuka
authored andcommitted
[Instrumentation] Fix typos across files in Transforms/Instrumentation (llvm#165251)
Closes llvm#165240.
1 parent 9dc23d7 commit 32dd0b7

11 files changed

+26
-27
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ void AddressSanitizer::getInterestingMemoryOperands(
15391539
IID == Intrinsic::experimental_vp_strided_load) {
15401540
Stride = VPI->getOperand(PtrOpNo + 1);
15411541
// Use the pointer alignment as the element alignment if the stride is a
1542-
// mutiple of the pointer alignment. Otherwise, the element alignment
1542+
// multiple of the pointer alignment. Otherwise, the element alignment
15431543
// should be Align(1).
15441544
unsigned PointerAlign = Alignment.valueOrOne().value();
15451545
if (!isa<ConstantInt>(Stride) ||
@@ -2399,7 +2399,7 @@ void ModuleAddressSanitizer::instrumentGlobalsELF(
23992399

24002400
// Putting globals in a comdat changes the semantic and potentially cause
24012401
// false negative odr violations at link time. If odr indicators are used, we
2402-
// keep the comdat sections, as link time odr violations will be dectected on
2402+
// keep the comdat sections, as link time odr violations will be detected on
24032403
// the odr indicator symbols.
24042404
bool UseComdatForGlobalsGC = UseOdrIndicator && !UniqueModuleId.empty();
24052405

@@ -3858,7 +3858,7 @@ void FunctionStackPoisoner::handleDynamicAllocaCall(AllocaInst *AI) {
38583858
I->eraseFromParent();
38593859
}
38603860

3861-
// Replace all uses of AddessReturnedByAlloca with NewAddressPtr.
3861+
// Replace all uses of AddressReturnedByAlloca with NewAddressPtr.
38623862
AI->replaceAllUsesWith(NewAddressPtr);
38633863

38643864
// We are done. Erase old alloca from parent.

llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ class CHR {
359359
unsigned Count = 0;
360360
// Find out how many times region R is cloned. Note that if the parent
361361
// of R is cloned, R is also cloned, but R's clone count is not updated
362-
// from the clone of the parent. We need to accumlate all the counts
362+
// from the clone of the parent. We need to accumulate all the counts
363363
// from the ancestors to get the clone count.
364364
while (R) {
365365
Count += DuplicationCount[R];
@@ -1513,7 +1513,7 @@ static bool negateICmpIfUsedByBranchOrSelectOnly(ICmpInst *ICmp,
15131513
BI->swapSuccessors();
15141514
// Don't need to swap this in terms of
15151515
// TrueBiasedRegions/FalseBiasedRegions because true-based/false-based
1516-
// mean whehter the branch is likely go into the if-then rather than
1516+
// mean whether the branch is likely go into the if-then rather than
15171517
// successor0/successor1 and because we can tell which edge is the then or
15181518
// the else one by comparing the destination to the region exit block.
15191519
continue;

llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static cl::opt<unsigned>
8383
// ICP the candidate function even when only a declaration is present.
8484
static cl::opt<bool> ICPAllowDecls(
8585
"icp-allow-decls", cl::init(false), cl::Hidden,
86-
cl::desc("Promote the target candidate even when the defintion "
86+
cl::desc("Promote the target candidate even when the definition "
8787
" is not available"));
8888

8989
// ICP hot candidate functions only. When setting to false, non-cold functions

llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ cl::opt<bool> ConditionalCounterUpdate(
139139
cl::init(false));
140140

141141
// If the option is not specified, the default behavior about whether
142-
// counter promotion is done depends on how instrumentaiton lowering
142+
// counter promotion is done depends on how instrumentation lowering
143143
// pipeline is setup, i.e., the default value of true of this option
144144
// does not mean the promotion will be done by default. Explicitly
145145
// setting this option can override the default behavior.
@@ -1052,7 +1052,7 @@ void InstrLowerer::lowerValueProfileInst(InstrProfValueProfileInst *Ind) {
10521052
GlobalVariable *Name = Ind->getName();
10531053
auto It = ProfileDataMap.find(Name);
10541054
assert(It != ProfileDataMap.end() && It->second.DataVar &&
1055-
"value profiling detected in function with no counter incerement");
1055+
"value profiling detected in function with no counter increment");
10561056

10571057
GlobalVariable *DataVar = It->second.DataVar;
10581058
uint64_t ValueKind = Ind->getValueKind()->getZExtValue();

llvm/lib/Transforms/Instrumentation/MemProfInstrumentation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ void createProfileFileNameVar(Module &M) {
490490
}
491491
}
492492

493-
// Set MemprofHistogramFlag as a Global veriable in IR. This makes it accessible
493+
// Set MemprofHistogramFlag as a Global variable in IR. This makes it accessible
494494
// to the runtime, changing shadow count behavior.
495495
void createMemprofHistogramFlagVar(Module &M) {
496496
const StringRef VarName(MemProfHistogramFlagVar);

llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3136,7 +3136,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
31363136
/// If we don't instrument it and it gets inlined,
31373137
/// our interceptor will not kick in and we will lose the memmove.
31383138
/// If we instrument the call here, but it does not get inlined,
3139-
/// we will memove the shadow twice: which is bad in case
3139+
/// we will memmove the shadow twice: which is bad in case
31403140
/// of overlapping regions. So, we simply lower the intrinsic to a call.
31413141
///
31423142
/// Similar situation exists for memcpy and memset.
@@ -4775,7 +4775,7 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
47754775

47764776
// _mm_round_ps / _mm_round_ps.
47774777
// Similar to maybeHandleSimpleNomemIntrinsic except
4778-
// the second argument is guranteed to be a constant integer.
4778+
// the second argument is guaranteed to be a constant integer.
47794779
void handleRoundPdPsIntrinsic(IntrinsicInst &I) {
47804780
assert(I.getArgOperand(0)->getType() == I.getType());
47814781
assert(I.arg_size() == 2);

llvm/lib/Transforms/Instrumentation/PGOCtxProfFlattening.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ PreservedAnalyses PGOCtxProfFlatteningPass::run(Module &M,
176176
assert(areAllBBsReachable(
177177
F, MAM.getResult<FunctionAnalysisManagerModuleProxy>(M)
178178
.getManager()) &&
179-
"Function has unreacheable basic blocks. The expectation was that "
179+
"Function has unreachable basic blocks. The expectation was that "
180180
"DCE was run before.");
181181

182182
auto It = FlattenedProfile.find(AssignGUIDPass::getGUID(F));

llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
253253
Value *RealContext = nullptr;
254254

255255
StructType *ThisContextType = nullptr;
256-
Value *TheRootFuctionData = nullptr;
256+
Value *TheRootFunctionData = nullptr;
257257
Value *ExpectedCalleeTLSAddr = nullptr;
258258
Value *CallsiteInfoTLSAddr = nullptr;
259259
const bool HasMusttail = [&F]() {
@@ -283,36 +283,35 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
283283
Guid = Builder.getInt64(
284284
AssignGUIDPass::getGUID(cast<Function>(*Mark->getNameValue())));
285285
// The type of the context of this function is now knowable since we have
286-
// NumCallsites and NumCounters. We delcare it here because it's more
286+
// NumCallsites and NumCounters. We declare it here because it's more
287287
// convenient - we have the Builder.
288288
ThisContextType = StructType::get(
289289
F.getContext(),
290290
{ContextNodeTy, ArrayType::get(Builder.getInt64Ty(), NumCounters),
291291
ArrayType::get(Builder.getPtrTy(), NumCallsites)});
292292
// Figure out which way we obtain the context object for this function -
293293
// if it's an entrypoint, then we call StartCtx, otherwise GetCtx. In the
294-
// former case, we also set TheRootFuctionData since we need to release it
295-
// at the end (plus it can be used to know if we have an entrypoint or a
296-
// regular function)
297-
// Don't set a name, they end up taking a lot of space and we don't need
298-
// them.
294+
// former case, we also set TheRootFunctionData since we need to release
295+
// it at the end (plus it can be used to know if we have an entrypoint or
296+
// a regular function). Don't set a name, they end up taking a lot of
297+
// space and we don't need them.
299298

300299
// Zero-initialize the FunctionData, except for functions that have
301300
// musttail calls. There, we set the CtxRoot field to 1, which will be
302301
// treated as a "can't be set as root".
303-
TheRootFuctionData = new GlobalVariable(
302+
TheRootFunctionData = new GlobalVariable(
304303
M, FunctionDataTy, false, GlobalVariable::InternalLinkage,
305304
HasMusttail ? CannotBeRootInitializer
306305
: Constant::getNullValue(FunctionDataTy));
307306

308307
if (ContextRootSet.contains(&F)) {
309308
Context = Builder.CreateCall(
310-
StartCtx, {TheRootFuctionData, Guid, Builder.getInt32(NumCounters),
309+
StartCtx, {TheRootFunctionData, Guid, Builder.getInt32(NumCounters),
311310
Builder.getInt32(NumCallsites)});
312311
ORE.emit(
313312
[&] { return OptimizationRemark(DEBUG_TYPE, "Entrypoint", &F); });
314313
} else {
315-
Context = Builder.CreateCall(GetCtx, {TheRootFuctionData, &F, Guid,
314+
Context = Builder.CreateCall(GetCtx, {TheRootFunctionData, &F, Guid,
316315
Builder.getInt32(NumCounters),
317316
Builder.getInt32(NumCallsites)});
318317
ORE.emit([&] {
@@ -399,7 +398,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
399398
} else if (!HasMusttail && isa<ReturnInst>(I)) {
400399
// Remember to release the context if we are an entrypoint.
401400
IRBuilder<> Builder(&I);
402-
Builder.CreateCall(ReleaseCtx, {TheRootFuctionData});
401+
Builder.CreateCall(ReleaseCtx, {TheRootFunctionData});
403402
ContextWasReleased = true;
404403
}
405404
}

llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ static bool InstrumentAllFunctions(
19571957
function_ref<BlockFrequencyInfo *(Function &)> LookupBFI,
19581958
function_ref<LoopInfo *(Function &)> LookupLI,
19591959
PGOInstrumentationType InstrumentationType) {
1960-
// For the context-sensitve instrumentation, we should have a separated pass
1960+
// For the context-sensitive instrumentation, we should have a separated pass
19611961
// (before LTO/ThinLTO linking) to create these variables.
19621962
if (InstrumentationType == PGOInstrumentationType::FDO)
19631963
createIRLevelProfileFlagVar(M, InstrumentationType);
@@ -2248,7 +2248,7 @@ static bool annotateAllFunctions(
22482248
Func.populateCoverage();
22492249
continue;
22502250
}
2251-
// When PseudoKind is set to a vaule other than InstrProfRecord::NotPseudo,
2251+
// When PseudoKind is set to a value other than InstrProfRecord::NotPseudo,
22522252
// it means the profile for the function is unrepresentative and this
22532253
// function is actually hot / warm. We will reset the function hot / cold
22542254
// attribute and drop all the profile counters.

llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static bool isVtableAccess(Instruction *I) {
355355
}
356356

357357
// Do not instrument known races/"benign races" that come from compiler
358-
// instrumentatin. The user has no way of suppressing them.
358+
// instrumentation. The user has no way of suppressing them.
359359
static bool shouldInstrumentReadWriteFromAddress(const Module *M, Value *Addr) {
360360
// Peel off GEPs and BitCasts.
361361
Addr = Addr->stripInBoundsOffsets();

0 commit comments

Comments
 (0)