diff options
| author | Tobias Grosser <tobias@grosser.es> | 2016-07-28 06:47:53 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2016-07-28 06:47:53 +0000 |
| commit | 44143bb927ce58beabd92adbd4115364a4c093c4 (patch) | |
| tree | 70b77ae97d357683740145b6cb8022e1e91e88ab /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
| parent | 4e18d71c71788654dd5c3e3b151ada8666b91029 (diff) | |
| download | bcm5719-llvm-44143bb927ce58beabd92adbd4115364a4c093c4.tar.gz bcm5719-llvm-44143bb927ce58beabd92adbd4115364a4c093c4.zip | |
GPGPU: use current 'Index' to find slot in parameter array
Before this change we used the array index, which would result in us accessing
the parameter array out-of-bounds. This bug was visible for test cases where not
all arrays in a scop are passed to a given kernel.
llvm-svn: 276961
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 20ab4999cf7..3a6b80b75a3 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -903,8 +903,8 @@ Value *GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Builder.getInt8PtrTy(), Launch + "_param_" + std::to_string(Index), EntryBlock->getTerminator()); Builder.CreateStore(DevArray, Param); - Value *Slot = Builder.CreateGEP(Parameters, - {Builder.getInt64(0), Builder.getInt64(i)}); + Value *Slot = Builder.CreateGEP( + Parameters, {Builder.getInt64(0), Builder.getInt64(Index)}); Value *ParamTyped = Builder.CreatePointerCast(Param, Builder.getInt8PtrTy()); Builder.CreateStore(ParamTyped, Slot); |

