mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-26 01:39:11 +00:00
SAdjust to recent change in constructor definition of AllocaInst
llvm-svn: 299913
This commit is contained in:
parent
92ce1e76c5
commit
67726b3260
@ -408,8 +408,8 @@ Value *BlockGenerator::getOrCreateAlloca(const ScopArrayInfo *Array) {
|
||||
else
|
||||
NameExt = ".s2a";
|
||||
|
||||
const DataLayout &DL
|
||||
= Builder.GetInsertBlock()->getParent()->getParent()->getDataLayout();
|
||||
const DataLayout &DL =
|
||||
Builder.GetInsertBlock()->getParent()->getParent()->getDataLayout();
|
||||
|
||||
Addr = new AllocaInst(Ty, DL.getAllocaAddrSpace(),
|
||||
ScalarBase->getName() + NameExt);
|
||||
|
@ -281,8 +281,8 @@ ParallelLoopGenerator::storeValuesIntoStruct(SetVector<Value *> &Values) {
|
||||
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
|
||||
|
@ -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,8 +1116,9 @@ 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),
|
||||
Instruction *Param =
|
||||
new AllocaInst(Builder.getInt8PtrTy(), AddressSpace,
|
||||
Launch + "_param_" + std::to_string(Index),
|
||||
EntryBlock->getTerminator());
|
||||
Builder.CreateStore(DevArray, Param);
|
||||
Value *ParamTyped =
|
||||
@ -1132,8 +1134,9 @@ 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),
|
||||
Instruction *Param =
|
||||
new AllocaInst(Val->getType(), AddressSpace,
|
||||
Launch + "_param_" + std::to_string(Index),
|
||||
EntryBlock->getTerminator());
|
||||
Builder.CreateStore(Val, Param);
|
||||
Value *Slot = Builder.CreateGEP(
|
||||
@ -1150,8 +1153,9 @@ 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),
|
||||
Instruction *Param =
|
||||
new AllocaInst(Val->getType(), AddressSpace,
|
||||
Launch + "_param_" + std::to_string(Index),
|
||||
EntryBlock->getTerminator());
|
||||
Builder.CreateStore(Val, Param);
|
||||
Value *Slot = Builder.CreateGEP(
|
||||
@ -1163,8 +1167,9 @@ GPUNodeBuilder::createLaunchParameters(ppcg_kernel *Kernel, Function *F,
|
||||
}
|
||||
|
||||
for (auto Val : SubtreeValues) {
|
||||
Instruction *Param = new AllocaInst(
|
||||
Val->getType(), Launch + "_param_" + std::to_string(Index),
|
||||
Instruction *Param =
|
||||
new AllocaInst(Val->getType(), AddressSpace,
|
||||
Launch + "_param_" + std::to_string(Index),
|
||||
EntryBlock->getTerminator());
|
||||
Builder.CreateStore(Val, Param);
|
||||
Value *Slot = Builder.CreateGEP(
|
||||
|
Loading…
Reference in New Issue
Block a user