summaryrefslogtreecommitdiff
path: root/polly/lib/CodeGen/LoopGenerators.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-04-11 00:12:58 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-04-11 00:12:58 +0000
commitb3e30c32ce6ac2cc73192df19dfe712e5be0364d (patch)
treed7b3a3017555ad5e4f75ed11f7e2035b2199655b /polly/lib/CodeGen/LoopGenerators.cpp
parentbf80cfe6b62d7fbd2f7d9be2a477fe4f5ad2d125 (diff)
Update for alloca construction changes
llvm-svn: 299905
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 564e71206473..de8a21d2fc02 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);