summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen/LoopGenerators.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/CodeGen/LoopGenerators.cpp')
-rw-r--r--polly/lib/CodeGen/LoopGenerators.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/polly/lib/CodeGen/LoopGenerators.cpp b/polly/lib/CodeGen/LoopGenerators.cpp
index 564e7120647..de8a21d2fc0 100644
--- a/polly/lib/CodeGen/LoopGenerators.cpp
+++ b/polly/lib/CodeGen/LoopGenerators.cpp
@@ -281,13 +281,17 @@ ParallelLoopGenerator::storeValuesIntoStruct(SetVector<Value *> &Values) {
for (Value *V : Values)
Members.push_back(V->getType());
+ const DataLayout &DL
+ = Builder.GetInsertBlock()->getParent()->getParent()->getDataLayout();
+
// We do not want to allocate the alloca inside any loop, thus we allocate it
// in the entry block of the function and use annotations to denote the actual
// live span (similar to clang).
BasicBlock &EntryBB = Builder.GetInsertBlock()->getParent()->getEntryBlock();
Instruction *IP = &*EntryBB.getFirstInsertionPt();
StructType *Ty = StructType::get(Builder.getContext(), Members);
- AllocaInst *Struct = new AllocaInst(Ty, nullptr, "polly.par.userContext", IP);
+ AllocaInst *Struct = new AllocaInst(Ty, DL.getAllocaAddrSpace(), nullptr,
+ "polly.par.userContext", IP);
for (unsigned i = 0; i < Values.size(); i++) {
Value *Address = Builder.CreateStructGEP(Ty, Struct, i);
OpenPOWER on IntegriCloud