From a3ef858968d3a7c4da03cd9126a2909dbd64c1d4 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 27 Nov 2023 20:58:25 -0800 Subject: [mlir,polly] Replace uses of IRBuilder::getInt8PtrTy with getPtrTy. NFC --- polly/lib/CodeGen/LoopGeneratorsGOMP.cpp | 6 +++--- polly/lib/CodeGen/LoopGeneratorsKMP.cpp | 4 ++-- polly/lib/CodeGen/PerfMonitor.cpp | 12 ++++++------ polly/lib/CodeGen/RuntimeDebugBuilder.cpp | 7 +++---- 4 files changed, 14 insertions(+), 15 deletions(-) (limited to 'polly') diff --git a/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp b/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp index 254c5e9..e7512c1 100644 --- a/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp +++ b/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp @@ -30,8 +30,8 @@ void ParallelLoopGeneratorGOMP::createCallSpawnThreads(Value *SubFn, GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; Type *Params[] = {PointerType::getUnqual(FunctionType::get( - Builder.getVoidTy(), Builder.getInt8PtrTy(), false)), - Builder.getInt8PtrTy(), + Builder.getVoidTy(), Builder.getPtrTy(), false)), + Builder.getPtrTy(), Builder.getInt32Ty(), LongType, LongType, @@ -61,7 +61,7 @@ void ParallelLoopGeneratorGOMP::deployParallelExecution(Function *SubFn, Function *ParallelLoopGeneratorGOMP::prepareSubFnDefinition(Function *F) const { FunctionType *FT = - FunctionType::get(Builder.getVoidTy(), {Builder.getInt8PtrTy()}, false); + FunctionType::get(Builder.getVoidTy(), {Builder.getPtrTy()}, false); Function *SubFn = Function::Create(FT, Function::InternalLinkage, F->getName() + "_polly_subfn", M); // Name the function's arguments diff --git a/polly/lib/CodeGen/LoopGeneratorsKMP.cpp b/polly/lib/CodeGen/LoopGeneratorsKMP.cpp index 5bcfa66..b3af7b1 100644 --- a/polly/lib/CodeGen/LoopGeneratorsKMP.cpp +++ b/polly/lib/CodeGen/LoopGeneratorsKMP.cpp @@ -81,7 +81,7 @@ Function *ParallelLoopGeneratorKMP::prepareSubFnDefinition(Function *F) const { LongType, LongType, LongType, - Builder.getInt8PtrTy()}; + Builder.getPtrTy()}; FunctionType *FT = FunctionType::get(Builder.getVoidTy(), Arguments, false); Function *SubFn = Function::Create(FT, Function::InternalLinkage, @@ -512,7 +512,7 @@ GlobalVariable *ParallelLoopGeneratorKMP::createSourceLocation() { if (!IdentTy) { Type *LocMembers[] = {Builder.getInt32Ty(), Builder.getInt32Ty(), Builder.getInt32Ty(), Builder.getInt32Ty(), - Builder.getInt8PtrTy()}; + Builder.getPtrTy()}; IdentTy = StructType::create(M->getContext(), LocMembers, StructName, false); diff --git a/polly/lib/CodeGen/PerfMonitor.cpp b/polly/lib/CodeGen/PerfMonitor.cpp index 8ffcb64..056d5b3 100644 --- a/polly/lib/CodeGen/PerfMonitor.cpp +++ b/polly/lib/CodeGen/PerfMonitor.cpp @@ -24,8 +24,8 @@ Function *PerfMonitor::getAtExit() { if (!F) { GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; - FunctionType *Ty = FunctionType::get(Builder.getInt32Ty(), - {Builder.getInt8PtrTy()}, false); + FunctionType *Ty = + FunctionType::get(Builder.getInt32Ty(), {Builder.getPtrTy()}, false); F = Function::Create(Ty, Linkage, Name, M); } @@ -44,12 +44,12 @@ void PerfMonitor::addToGlobalConstructors(Function *Fn) { GV->eraseFromParent(); } - StructType *ST = StructType::get(Builder.getInt32Ty(), Fn->getType(), - Builder.getInt8PtrTy()); + StructType *ST = + StructType::get(Builder.getInt32Ty(), Fn->getType(), Builder.getPtrTy()); V.push_back( ConstantStruct::get(ST, Builder.getInt32(10), Fn, - ConstantPointerNull::get(Builder.getInt8PtrTy()))); + ConstantPointerNull::get(Builder.getPtrTy()))); ArrayType *Ty = ArrayType::get(ST, V.size()); GV = new GlobalVariable(*M, Ty, true, GlobalValue::AppendingLinkage, @@ -246,7 +246,7 @@ Function *PerfMonitor::insertInitFunction(Function *FinalReporting) { // Register the final reporting function with atexit(). Value *FinalReportingPtr = - Builder.CreatePointerCast(FinalReporting, Builder.getInt8PtrTy()); + Builder.CreatePointerCast(FinalReporting, Builder.getPtrTy()); Function *AtExitFn = getAtExit(); Builder.CreateCall(AtExitFn, {FinalReportingPtr}); diff --git a/polly/lib/CodeGen/RuntimeDebugBuilder.cpp b/polly/lib/CodeGen/RuntimeDebugBuilder.cpp index fe30924..8a29b0a 100644 --- a/polly/lib/CodeGen/RuntimeDebugBuilder.cpp +++ b/polly/lib/CodeGen/RuntimeDebugBuilder.cpp @@ -34,8 +34,7 @@ Function *RuntimeDebugBuilder::getVPrintF(PollyIRBuilder &Builder) { if (!F) { GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; FunctionType *Ty = FunctionType::get( - Builder.getInt32Ty(), {Builder.getInt8PtrTy(), Builder.getInt8PtrTy()}, - false); + Builder.getInt32Ty(), {Builder.getPtrTy(), Builder.getPtrTy()}, false); F = Function::Create(Ty, Linkage, Name, M); } @@ -78,7 +77,7 @@ prepareValuesForPrinting(PollyIRBuilder &Builder, ArrayRef Values) { assert(Ty->getIntegerBitWidth() && "Integer types larger 64 bit not supported"); } else if (isa(Ty)) { - if (Ty == Builder.getInt8PtrTy(4)) { + if (Ty == Builder.getPtrTy(4)) { Val = Builder.CreateGEP(Builder.getInt8Ty(), Val, Builder.getInt64(0)); } else { Val = Builder.CreatePtrToInt(Val, Builder.getInt64Ty()); @@ -148,7 +147,7 @@ void RuntimeDebugBuilder::createFlush(PollyIRBuilder &Builder) { if (!F) { GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage; FunctionType *Ty = - FunctionType::get(Builder.getInt32Ty(), Builder.getInt8PtrTy(), false); + FunctionType::get(Builder.getInt32Ty(), Builder.getPtrTy(), false); F = Function::Create(Ty, Linkage, Name, M); } -- cgit v1.1