summaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-03-17 15:58:52 +0100
committerNikita Popov <npopov@redhat.com>2023-03-17 15:59:19 +0100
commit18680a36aa1b125cbde3fa0a10fa53db2b697f3a (patch)
tree15a6f118d20718b8e996bc69ee92d47cd25c9af5 /polly
parentcd47f5bb5987667a1761059fa216437d9f1d97c9 (diff)
downloadllvm-18680a36aa1b125cbde3fa0a10fa53db2b697f3a.tar.gz
[Polly] Remove some bitcasts (NFC)
No longer relevant with opaque pointers.
Diffstat (limited to 'polly')
-rw-r--r--polly/lib/CodeGen/IslExprBuilder.cpp7
-rw-r--r--polly/lib/CodeGen/LoopGenerators.cpp5
-rw-r--r--polly/lib/CodeGen/LoopGeneratorsGOMP.cpp3
-rw-r--r--polly/lib/CodeGen/LoopGeneratorsKMP.cpp6
4 files changed, 3 insertions, 18 deletions
diff --git a/polly/lib/CodeGen/IslExprBuilder.cpp b/polly/lib/CodeGen/IslExprBuilder.cpp
index 12b724c8f7bf..f40511e0273a 100644
--- a/polly/lib/CodeGen/IslExprBuilder.cpp
+++ b/polly/lib/CodeGen/IslExprBuilder.cpp
@@ -271,13 +271,6 @@ IslExprBuilder::createAccessAddress(__isl_take isl_ast_expr *Expr) {
assert(Base->getType()->isPointerTy() && "Access base should be a pointer");
StringRef BaseName = Base->getName();
- auto PointerTy = PointerType::get(SAI->getElementType(),
- Base->getType()->getPointerAddressSpace());
- if (Base->getType() != PointerTy) {
- Base =
- Builder.CreateBitCast(Base, PointerTy, "polly.access.cast." + BaseName);
- }
-
if (isl_ast_expr_get_op_n_arg(Expr) == 1) {
isl_ast_expr_free(Expr);
if (PollyDebugPrinting)
diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp
index ebd4b22476c9..5c99515c5444 100644
--- a/polly/lib/CodeGen/LoopGenerators.cpp
+++ b/polly/lib/CodeGen/LoopGenerators.cpp
@@ -186,15 +186,12 @@ Value *ParallelLoopGenerator::createParallelLoop(
*LoopBody = Builder.GetInsertPoint();
Builder.SetInsertPoint(&*BeforeLoop);
- Value *SubFnParam = Builder.CreateBitCast(Struct, Builder.getInt8PtrTy(),
- "polly.par.userContext");
-
// Add one as the upper bound provided by OpenMP is a < comparison
// whereas the codegenForSequential function creates a <= comparison.
UB = Builder.CreateAdd(UB, ConstantInt::get(LongType, 1));
// Execute the prepared subfunction in parallel.
- deployParallelExecution(SubFn, SubFnParam, LB, UB, Stride);
+ deployParallelExecution(SubFn, Struct, LB, UB, Stride);
return IV;
}
diff --git a/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp b/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
index 1013f12e2a79..254c5e973f66 100644
--- a/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
+++ b/polly/lib/CodeGen/LoopGeneratorsGOMP.cpp
@@ -128,8 +128,7 @@ ParallelLoopGeneratorGOMP::createSubFn(Value *Stride, AllocaInst *StructData,
Builder.SetInsertPoint(HeaderBB);
Value *LBPtr = Builder.CreateAlloca(LongType, nullptr, "polly.par.LBPtr");
Value *UBPtr = Builder.CreateAlloca(LongType, nullptr, "polly.par.UBPtr");
- Value *UserContext = Builder.CreateBitCast(
- &*SubFn->arg_begin(), StructData->getType(), "polly.par.userContext");
+ Value *UserContext = &*SubFn->arg_begin();
extractValuesFromStruct(Data, StructData->getAllocatedType(), UserContext,
Map);
diff --git a/polly/lib/CodeGen/LoopGeneratorsKMP.cpp b/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
index 5244e89e3107..5bcfa664c11b 100644
--- a/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
+++ b/polly/lib/CodeGen/LoopGeneratorsKMP.cpp
@@ -175,11 +175,7 @@ ParallelLoopGeneratorKMP::createSubFn(Value *SequentialLoopStride,
std::advance(AI, 1);
Value *Shared = &*AI;
- Value *UserContext = Builder.CreateBitCast(Shared, StructData->getType(),
- "polly.par.userContext");
-
- extractValuesFromStruct(Data, StructData->getAllocatedType(), UserContext,
- Map);
+ extractValuesFromStruct(Data, StructData->getAllocatedType(), Shared, Map);
const auto Alignment = llvm::Align(is64BitArch() ? 8 : 4);
Value *ID = Builder.CreateAlignedLoad(Builder.getInt32Ty(), IDPtr, Alignment,