[polly] 467a9bd - [polly] Avoid llvm::Type::getPointerTo() (NFC) (#112368)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 16 03:14:41 PDT 2024
Author: Youngsuk Kim
Date: 2024-10-16T06:14:38-04:00
New Revision: 467a9bde06e681cecc69afa18580aadf2ed9769b
URL: https://github.com/llvm/llvm-project/commit/467a9bde06e681cecc69afa18580aadf2ed9769b
DIFF: https://github.com/llvm/llvm-project/commit/467a9bde06e681cecc69afa18580aadf2ed9769b.diff
LOG: [polly] Avoid llvm::Type::getPointerTo() (NFC) (#112368)
`llvm::Type::getPointerTo()` is to be deprecated & removed soon.
Also, avoid pointercasts that are essentially no-ops.
Added:
Modified:
polly/lib/CodeGen/BlockGenerators.cpp
polly/lib/CodeGen/IslNodeBuilder.cpp
polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
Removed:
################################################################################
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index c58763603cfa22..b76d8f4c18a551 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -786,12 +786,6 @@ void BlockGenerator::generateScalarStores(
Builder.GetInsertBlock())) &&
"Domination violation");
- // The new Val might have a
diff erent 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);
});
}
diff --git a/polly/lib/CodeGen/IslNodeBuilder.cpp b/polly/lib/CodeGen/IslNodeBuilder.cpp
index 3f07f02038a1ec..d76f6251ea4ced 100644
--- a/polly/lib/CodeGen/IslNodeBuilder.cpp
+++ b/polly/lib/CodeGen/IslNodeBuilder.cpp
@@ -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());
diff --git a/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp b/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
index cd440b28202e6d..b98416a92097f2 100644
--- a/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
+++ b/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
@@ -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);
}
More information about the llvm-commits
mailing list