From b3e30c32ce6ac2cc73192df19dfe712e5be0364d Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Tue, 11 Apr 2017 00:12:58 +0000 Subject: Update for alloca construction changes llvm-svn: 299905 --- polly/lib/CodeGen/LoopGenerators.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'polly/lib/CodeGen/LoopGenerators.cpp') 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 &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); -- cgit v1.2.3