summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/PPCGCodeGeneration.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2017-04-11 04:23:38 +0000
committerTobias Grosser <tobias@grosser.es>2017-04-11 04:23:38 +0000
commit67726b326085026131fa657469b4e11347387e42 (patch)
tree80cd2612a87965b02442831a3e2af30e31a0860c /polly/lib/CodeGen/PPCGCodeGeneration.cpp
parent92ce1e76c5995e3188d481bb3c8c5f1377ddab1b (diff)
downloadbcm5719-llvm-67726b326085026131fa657469b4e11347387e42.tar.gz
bcm5719-llvm-67726b326085026131fa657469b4e11347387e42.zip
SAdjust to recent change in constructor definition of AllocaInst
llvm-svn: 299913
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r--polly/lib/CodeGen/PPCGCodeGeneration.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
index 2bd1b425811..3fe6713d53b 100644
--- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp
+++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp
@@ -1083,9 +1083,10 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
BasicBlock *EntryBlock =
&Builder.GetInsertBlock()->getParent()->getEntryBlock();
+ auto AddressSpace = F->getParent()->getDataLayout().getAllocaAddrSpace();
std::string Launch = "polly_launch_" + std::to_string(Kernel->id);
- Instruction *Parameters =
- new AllocaInst(ArrayTy, Launch + "_params", EntryBlock->getTerminator());
+ Instruction *Parameters = new AllocaInst(
+ ArrayTy, AddressSpace, Launch + "_params", EntryBlock->getTerminator());
int Index = 0;
for (long i = 0; i < Prog->n_array; i++) {
@@ -1115,9 +1116,10 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
Builder.CreatePointerCast(ValPtr, Builder.getInt8PtrTy());
Builder.CreateStore(ValPtrCast, Slot);
} else {
- Instruction *Param = new AllocaInst(
- Builder.getInt8PtrTy(), Launch + "_param_" + std::to_string(Index),
- EntryBlock->getTerminator());
+ Instruction *Param =
+ new AllocaInst(Builder.getInt8PtrTy(), AddressSpace,
+ Launch + "_param_" + std::to_string(Index),
+ EntryBlock->getTerminator());
Builder.CreateStore(DevArray, Param);
Value *ParamTyped =
Builder.CreatePointerCast(Param, Builder.getInt8PtrTy());
@@ -1132,9 +1134,10 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
isl_id *Id = isl_space_get_dim_id(Kernel->space, isl_dim_set, i);
Value *Val = IDToValue[Id];
isl_id_free(Id);
- Instruction *Param = new AllocaInst(
- Val->getType(), Launch + "_param_" + std::to_string(Index),
- EntryBlock->getTerminator());
+ Instruction *Param =
+ new AllocaInst(Val->getType(), AddressSpace,
+ Launch + "_param_" + std::to_string(Index),
+ EntryBlock->getTerminator());
Builder.CreateStore(Val, Param);
Value *Slot = Builder.CreateGEP(
Parameters, {Builder.getInt64(0), Builder.getInt64(Index)});
@@ -1150,9 +1153,10 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
isl_id *Id = isl_space_get_dim_id(Kernel->space, isl_dim_param, i);
Value *Val = IDToValue[Id];
isl_id_free(Id);
- Instruction *Param = new AllocaInst(
- Val->getType(), Launch + "_param_" + std::to_string(Index),
- EntryBlock->getTerminator());
+ Instruction *Param =
+ new AllocaInst(Val->getType(), AddressSpace,
+ Launch + "_param_" + std::to_string(Index),
+ EntryBlock->getTerminator());
Builder.CreateStore(Val, Param);
Value *Slot = Builder.CreateGEP(
Parameters, {Builder.getInt64(0), Builder.getInt64(Index)});
@@ -1163,9 +1167,10 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
}
for (auto Val : SubtreeValues) {
- Instruction *Param = new AllocaInst(
- Val->getType(), Launch + "_param_" + std::to_string(Index),
- EntryBlock->getTerminator());
+ Instruction *Param =
+ new AllocaInst(Val->getType(), AddressSpace,
+ Launch + "_param_" + std::to_string(Index),
+ EntryBlock->getTerminator());
Builder.CreateStore(Val, Param);
Value *Slot = Builder.CreateGEP(
Parameters, {Builder.getInt64(0), Builder.getInt64(Index)});
OpenPOWER on IntegriCloud