Skip to content

Commit f0ed31c

Browse files
authored
[llvm][PGOCtxProfLowering] Avoid Type::getPointerTo() (NFC) (#111857)
`Type::getPointerTo()` is to be deprecated & removed soon.
1 parent d5e1de6 commit f0ed31c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

llvm/lib/Transforms/Instrumentation/PGOCtxProfLowering.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,28 @@ CtxInstrumentationLowerer::CtxInstrumentationLowerer(Module &M,
154154
StartCtx = cast<Function>(
155155
M.getOrInsertFunction(
156156
CompilerRtAPINames::StartCtx,
157-
FunctionType::get(ContextNodeTy->getPointerTo(),
158-
{ContextRootTy->getPointerTo(), /*ContextRoot*/
157+
FunctionType::get(PointerTy,
158+
{PointerTy, /*ContextRoot*/
159159
I64Ty, /*Guid*/ I32Ty,
160160
/*NumCounters*/ I32Ty /*NumCallsites*/},
161161
false))
162162
.getCallee());
163163
GetCtx = cast<Function>(
164164
M.getOrInsertFunction(CompilerRtAPINames::GetCtx,
165-
FunctionType::get(ContextNodeTy->getPointerTo(),
165+
FunctionType::get(PointerTy,
166166
{PointerTy, /*Callee*/
167167
I64Ty, /*Guid*/
168168
I32Ty, /*NumCounters*/
169169
I32Ty}, /*NumCallsites*/
170170
false))
171171
.getCallee());
172172
ReleaseCtx = cast<Function>(
173-
M.getOrInsertFunction(
174-
CompilerRtAPINames::ReleaseCtx,
175-
FunctionType::get(Type::getVoidTy(M.getContext()),
176-
{
177-
ContextRootTy->getPointerTo(), /*ContextRoot*/
178-
},
179-
false))
173+
M.getOrInsertFunction(CompilerRtAPINames::ReleaseCtx,
174+
FunctionType::get(Type::getVoidTy(M.getContext()),
175+
{
176+
PointerTy, /*ContextRoot*/
177+
},
178+
false))
180179
.getCallee());
181180

182181
// Declare the TLSes we will need to use.
@@ -264,7 +263,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
264263
auto *Index = Builder.CreateAnd(CtxAsInt, Builder.getInt64(1));
265264
// The GEPs corresponding to that index, in the respective TLS.
266265
ExpectedCalleeTLSAddr = Builder.CreateGEP(
267-
Builder.getInt8Ty()->getPointerTo(),
266+
PointerType::getUnqual(F.getContext()),
268267
Builder.CreateThreadLocalAddress(ExpectedCalleeTLS), {Index});
269268
CallsiteInfoTLSAddr = Builder.CreateGEP(
270269
Builder.getInt32Ty(),
@@ -277,7 +276,7 @@ bool CtxInstrumentationLowerer::lowerFunction(Function &F) {
277276
// with counters) stays the same.
278277
RealContext = Builder.CreateIntToPtr(
279278
Builder.CreateAnd(CtxAsInt, Builder.getInt64(-2)),
280-
ThisContextType->getPointerTo());
279+
PointerType::getUnqual(F.getContext()));
281280
I.eraseFromParent();
282281
break;
283282
}

0 commit comments

Comments
 (0)