[polly] r299913 - SAdjust to recent change in constructor definition of AllocaInst

Hongbin Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 21:45:28 PDT 2017


On Mon, Apr 10, 2017 at 9:23 PM, Tobias Grosser via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: grosser
> Date: Mon Apr 10 23:23:38 2017
> New Revision: 299913
>
> URL: http://llvm.org/viewvc/llvm-project?rev=299913&view=rev
> Log:
> SAdjust to recent change in constructor definition of AllocaInst
>
> Modified:
>     polly/trunk/lib/CodeGen/BlockGenerators.cpp
>     polly/trunk/lib/CodeGen/LoopGenerators.cpp
>     polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
>
> Modified: polly/trunk/lib/CodeGen/BlockGenerators.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/
> CodeGen/BlockGenerators.cpp?rev=299913&r1=299912&r2=299913&view=diff
> ============================================================
> ==================
> --- polly/trunk/lib/CodeGen/BlockGenerators.cpp (original)
> +++ polly/trunk/lib/CodeGen/BlockGenerators.cpp Mon Apr 10 23:23:38 2017
> @@ -408,8 +408,8 @@ Value *BlockGenerator::getOrCreateAlloca
>    else
>      NameExt = ".s2a";
>
> -  const DataLayout &DL
> -    = Builder.GetInsertBlock()->getParent()->getParent()->
> getDataLayout();
> +  const DataLayout &DL =
> +      Builder.GetInsertBlock()->getParent()->getParent()->
> getDataLayout();
>
I remember in the newest LLVM, BasicBlock has a function "getModule" which
directly return the module


>
>    Addr = new AllocaInst(Ty, DL.getAllocaAddrSpace(),
>                          ScalarBase->getName() + NameExt);
>
> Modified: polly/trunk/lib/CodeGen/LoopGenerators.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/
> CodeGen/LoopGenerators.cpp?rev=299913&r1=299912&r2=299913&view=diff
> ============================================================
> ==================
> --- polly/trunk/lib/CodeGen/LoopGenerators.cpp (original)
> +++ polly/trunk/lib/CodeGen/LoopGenerators.cpp Mon Apr 10 23:23:38 2017
> @@ -281,8 +281,8 @@ ParallelLoopGenerator::storeValuesIntoSt
>    for (Value *V : Values)
>      Members.push_back(V->getType());
>
> -  const DataLayout &DL
> -    = Builder.GetInsertBlock()->getParent()->getParent()->
> getDataLayout();
> +  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
>
> Modified: polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp
> URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/
> CodeGen/PPCGCodeGeneration.cpp?rev=299913&r1=299912&r2=299913&view=diff
> ============================================================
> ==================
> --- polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp (original)
> +++ polly/trunk/lib/CodeGen/PPCGCodeGeneration.cpp Mon Apr 10 23:23:38
> 2017
> @@ -1083,9 +1083,10 @@ GPUNodeBuilder::createLaunchParameters(p
>
>    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(p
>            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(p
>      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(p
>      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(p
>    }
>
>    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)});
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170410/8976f615/attachment.html>


More information about the llvm-commits mailing list