diff options
| author | Nikita Popov <npopov@redhat.com> | 2022-04-19 17:09:11 +0200 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2022-04-19 17:09:34 +0200 |
| commit | ee6bd28f233f330b34d0a83453eeaf56b0cc87ee (patch) | |
| tree | a94bb1c1cddbb3f8b733650faaaf1c4b64ce6078 /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
| parent | 64c929ec0937ba7f66368a645835dacd7be29a99 (diff) | |
[PPCGCodeGeneration] Avoid pointer element type access
Pass through the ArrayTy instead.
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index bd5674d49902..a734207bf5e7 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -486,12 +486,13 @@ private: /// Store a specific kernel launch parameter in the array of kernel launch /// parameters. /// + /// @param ArrayTy Array type of \p Parameters. /// @param Parameters The list of parameters in which to store. /// @param Param The kernel launch parameter to store. /// @param Index The index in the parameter list, at which to store the /// parameter. - void insertStoreParameter(Instruction *Parameters, Instruction *Param, - int Index); + void insertStoreParameter(Type *ArrayTy, Instruction *Parameters, + Instruction *Param, int Index); /// Create kernel launch parameters. /// @@ -1625,11 +1626,11 @@ GPUNodeBuilder::getBlockSizes(ppcg_kernel *Kernel) { return std::make_tuple(Sizes[0], Sizes[1], Sizes[2]); } -void GPUNodeBuilder::insertStoreParameter(Instruction *Parameters, +void GPUNodeBuilder::insertStoreParameter(Type *ArrayTy, + Instruction *Parameters, Instruction *Param, int Index) { Value *Slot = Builder.CreateGEP( - Parameters->getType()->getPointerElementType(), Parameters, - {Builder.getInt64(0), Builder.getInt64(Index)}); + ArrayTy, Parameters, {Builder.getInt64(0), Builder.getInt64(Index)}); Value *ParamTyped = Builder.CreatePointerCast(Param, Builder.getInt8PtrTy()); Builder.CreateStore(ParamTyped, Slot); } @@ -1730,7 +1731,7 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F, Launch + "_param_" + std::to_string(Index), EntryBlock->getTerminator()); Builder.CreateStore(Val, Param); - insertStoreParameter(Parameters, Param, Index); + insertStoreParameter(ArrayTy, Parameters, Param, Index); Index++; } @@ -1751,7 +1752,7 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F, Launch + "_param_" + std::to_string(Index), EntryBlock->getTerminator()); Builder.CreateStore(Val, Param); - insertStoreParameter(Parameters, Param, Index); + insertStoreParameter(ArrayTy, Parameters, Param, Index); Index++; } @@ -1764,7 +1765,7 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F, Launch + "_param_" + std::to_string(Index), EntryBlock->getTerminator()); Builder.CreateStore(Val, Param); - insertStoreParameter(Parameters, Param, Index); + insertStoreParameter(ArrayTy, Parameters, Param, Index); Index++; } @@ -1776,7 +1777,7 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F, Launch + "_param_size_" + std::to_string(i), EntryBlock->getTerminator()); Builder.CreateStore(Val, Param); - insertStoreParameter(Parameters, Param, Index); + insertStoreParameter(ArrayTy, Parameters, Param, Index); Index++; } } |
