-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm][OMPIRBuilder] Avoid Type::getPointerTo() (NFC) #110678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`Type::getPointerTo()` is to be deprecated & removed soon.
@llvm/pr-subscribers-flang-openmp Author: Youngsuk Kim (JOE1994) Changes
Full diff: https://github.com/llvm/llvm-project/pull/110678.diff 1 Files Affected:
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index a90770f6ea2eeb..922c65d7fc3f5c 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -2278,7 +2278,7 @@ Value *OpenMPIRBuilder::castValueToType(InsertPointTy AllocaIP, Value *From,
Builder.restoreIP(SaveIP);
Value *ValCastItem = Builder.CreatePointerBitCastOrAddrSpaceCast(
- CastItem, FromType->getPointerTo());
+ CastItem, Builder.getPtrTy(0));
Builder.CreateStore(From, ValCastItem);
return Builder.CreateLoad(ToType, CastItem);
}
@@ -2328,11 +2328,11 @@ void OpenMPIRBuilder::shuffleAndStore(InsertPointTy AllocaIP, Value *SrcAddr,
continue;
Type *IntType = Builder.getIntNTy(IntSize * 8);
Ptr = Builder.CreatePointerBitCastOrAddrSpaceCast(
- Ptr, IntType->getPointerTo(), Ptr->getName() + ".ascast");
+ Ptr, Builder.getPtrTy(0), Ptr->getName() + ".ascast");
Value *SrcAddrGEP =
Builder.CreateGEP(ElemType, SrcAddr, {ConstantInt::get(IndexTy, 1)});
ElemPtr = Builder.CreatePointerBitCastOrAddrSpaceCast(
- ElemPtr, IntType->getPointerTo(), ElemPtr->getName() + ".ascast");
+ ElemPtr, Builder.getPtrTy(0), ElemPtr->getName() + ".ascast");
Function *CurFunc = Builder.GetInsertBlock()->getParent();
if ((Size / IntSize) > 1) {
@@ -2567,7 +2567,7 @@ Function *OpenMPIRBuilder::emitInterWarpCopyFunction(
Value *ReduceListAddrCast = Builder.CreatePointerBitCastOrAddrSpaceCast(
ReduceListAlloca, Arg0Type, ReduceListAlloca->getName() + ".ascast");
Value *NumWarpsAddrCast = Builder.CreatePointerBitCastOrAddrSpaceCast(
- NumWarpsAlloca, Arg1Type->getPointerTo(),
+ NumWarpsAlloca, Builder.getPtrTy(0),
NumWarpsAlloca->getName() + ".ascast");
Builder.CreateStore(ReduceListArg, ReduceListAddrCast);
Builder.CreateStore(NumWarpsArg, NumWarpsAddrCast);
@@ -2765,7 +2765,7 @@ Function *OpenMPIRBuilder::emitShuffleAndReduceFunction(
Type *ReduceListArgType = ReduceListArg->getType();
Type *LaneIDArgType = LaneIDArg->getType();
- Type *LaneIDArgPtrType = LaneIDArg->getType()->getPointerTo();
+ Type *LaneIDArgPtrType = Builder.getPtrTy(0);
Value *ReduceListAlloca = Builder.CreateAlloca(
ReduceListArgType, nullptr, ReduceListArg->getName() + ".addr");
Value *LaneIdAlloca = Builder.CreateAlloca(LaneIDArgType, nullptr,
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/73/builds/6437 Here is the relevant piece of the build log for the reference
|
`Type::getPointerTo()` is to be deprecated & removed soon.
Type::getPointerTo()
is to be deprecated & removed soon.