aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp b/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
index 0a358d4..de7c169 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp
@@ -253,7 +253,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
Value *RealContext = nullptr;
StructType *ThisContextType = nullptr;
- Value *TheRootFuctionData = nullptr;
+ Value *TheRootFunctionData = nullptr;
Value *ExpectedCalleeTLSAddr = nullptr;
Value *CallsiteInfoTLSAddr = nullptr;
const bool HasMusttail = [&F]() {
@@ -283,7 +283,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
Guid = Builder.getInt64(
AssignGUIDPass::getGUID(cast<Function>(*Mark->getNameValue())));
// The type of the context of this function is now knowable since we have
- // NumCallsites and NumCounters. We delcare it here because it's more
+ // NumCallsites and NumCounters. We declare it here because it's more
// convenient - we have the Builder.
ThisContextType = StructType::get(
F.getContext(),
@@ -291,28 +291,27 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
ArrayType::get(Builder.getPtrTy(), NumCallsites)});
// Figure out which way we obtain the context object for this function -
// if it's an entrypoint, then we call StartCtx, otherwise GetCtx. In the
- // former case, we also set TheRootFuctionData since we need to release it
- // at the end (plus it can be used to know if we have an entrypoint or a
- // regular function)
- // Don't set a name, they end up taking a lot of space and we don't need
- // them.
+ // former case, we also set TheRootFunctionData since we need to release
+ // it at the end (plus it can be used to know if we have an entrypoint or
+ // a regular function). Don't set a name, they end up taking a lot of
+ // space and we don't need them.
// Zero-initialize the FunctionData, except for functions that have
// musttail calls. There, we set the CtxRoot field to 1, which will be
// treated as a "can't be set as root".
- TheRootFuctionData = new GlobalVariable(
+ TheRootFunctionData = new GlobalVariable(
M, FunctionDataTy, false, GlobalVariable::InternalLinkage,
HasMusttail ? CannotBeRootInitializer
: Constant::getNullValue(FunctionDataTy));
if (ContextRootSet.contains(&F)) {
Context = Builder.CreateCall(
- StartCtx, {TheRootFuctionData, Guid, Builder.getInt32(NumCounters),
+ StartCtx, {TheRootFunctionData, Guid, Builder.getInt32(NumCounters),
Builder.getInt32(NumCallsites)});
ORE.emit(
[&] { return OptimizationRemark(DEBUG_TYPE, "Entrypoint", &F); });
} else {
- Context = Builder.CreateCall(GetCtx, {TheRootFuctionData, &F, Guid,
+ Context = Builder.CreateCall(GetCtx, {TheRootFunctionData, &F, Guid,
Builder.getInt32(NumCounters),
Builder.getInt32(NumCallsites)});
ORE.emit([&] {
@@ -399,7 +398,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
} else if (!HasMusttail && isa<ReturnInst>(I)) {
// Remember to release the context if we are an entrypoint.
IRBuilder<> Builder(&I);
- Builder.CreateCall(ReleaseCtx, {TheRootFuctionData});
+ Builder.CreateCall(ReleaseCtx, {TheRootFunctionData});
ContextWasReleased = true;
}
}