- Function *F = P->getParent()->getParent();
- AllocaInst *Slot = new AllocaInst(P->getType(), 0, P->getName(),
- F->getEntryBlock().begin());
+ AllocaInst *Slot;
+ if (AllocaPoint) {
+ Slot = new AllocaInst(P->getType(), 0, P->getName()+".reg2mem", AllocaPoint);
+ } else {
+ Function *F = P->getParent()->getParent();
+ Slot = new AllocaInst(P->getType(), 0, P->getName()+".reg2mem",
+ F->getEntryBlock().begin());
+ }