Displaying 1 result from an estimated 1 matches for "allocasize".
Did you mean:
alloc_size
2010 Mar 26
1
[LLVMdev] Using GetElementPtr to traverse large arrays
...ore, but I wasted
few hours and didn't find the solution..
What is the best way to traverse a large array (say size of million)
with GetElementPtr
The problem with the following code, is that it forces you to create
million constant index values:
intVars = new AllocaInst(Type::getInt32Ty(ctx), allocaSize, "intVars",
someBlock);
for(int i = 0; i < 1000000; i++)
{
Value *idx = ConstantInt::get(Type::getInt32Ty(ctx), i);
GetElementPtrInst *gep = GetElementPtrInst::Create(intVars, idx,
"ElemPtr", someBlock);
new StoreInst(idx, gep, entryBlock); //Store some value in it
}...