[polly] Avoid llvm::Type::getPointerTo() (NFC) (#112368)
`llvm::Type::getPointerTo()` is to be deprecated & removed soon. Also, avoid pointercasts that are essentially no-ops.
This commit is contained in:
@@ -786,12 +786,6 @@ void BlockGenerator::generateScalarStores(
|
||||
Builder.GetInsertBlock())) &&
|
||||
"Domination violation");
|
||||
|
||||
// The new Val might have a different type than the old Val due to
|
||||
// ScalarEvolution looking through bitcasts.
|
||||
Address = Builder.CreateBitOrPointerCast(
|
||||
Address, Val->getType()->getPointerTo(
|
||||
Address->getType()->getPointerAddressSpace()));
|
||||
|
||||
Builder.CreateStore(Val, Address);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1050,8 +1050,6 @@ Value *IslNodeBuilder::preloadUnconditionally(__isl_take isl_set *AccessRange,
|
||||
|
||||
auto *Ptr = AddressValue;
|
||||
auto Name = Ptr->getName();
|
||||
auto AS = Ptr->getType()->getPointerAddressSpace();
|
||||
Ptr = Builder.CreatePointerCast(Ptr, Ty->getPointerTo(AS), Name + ".cast");
|
||||
PreloadVal = Builder.CreateLoad(Ty, Ptr, Name + ".load");
|
||||
if (LoadInst *PreloadInst = dyn_cast<LoadInst>(PreloadVal))
|
||||
PreloadInst->setAlignment(cast<LoadInst>(AccInst)->getAlign());
|
||||
|
||||
@@ -183,7 +183,7 @@ Value *ParallelLoopGeneratorGOMP::createCallGetWorkItem(Value *LBPtr,
|
||||
// If F is not available, declare it.
|
||||
if (!F) {
|
||||
GlobalValue::LinkageTypes Linkage = Function::ExternalLinkage;
|
||||
Type *Params[] = {LongType->getPointerTo(), LongType->getPointerTo()};
|
||||
Type *Params[] = {Builder.getPtrTy(0), Builder.getPtrTy(0)};
|
||||
FunctionType *Ty = FunctionType::get(Builder.getInt8Ty(), Params, false);
|
||||
F = Function::Create(Ty, Linkage, Name, M);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user