51 return "convert address space of alloca'ed memory to local";
59 "Lower Alloca",
false,
false)
71 if (
auto allocaInst = dyn_cast<AllocaInst>(&
I)) {
73 auto ETy = allocaInst->getAllocatedType();
77 auto NewASCToGeneric =
79 NewASCToLocal->insertAfter(allocaInst);
80 NewASCToGeneric->insertAfter(NewASCToLocal);
87 auto LI = dyn_cast<LoadInst>(AllocaUse.getUser());
88 if (LI && LI->getPointerOperand() == allocaInst &&
90 LI->setOperand(LI->getPointerOperandIndex(), NewASCToGeneric);
93 auto SI = dyn_cast<StoreInst>(AllocaUse.getUser());
94 if (
SI &&
SI->getPointerOperand() == allocaInst &&
96 SI->setOperand(
SI->getPointerOperandIndex(), NewASCToGeneric);
99 auto GI = dyn_cast<GetElementPtrInst>(AllocaUse.getUser());
100 if (GI && GI->getPointerOperand() == allocaInst) {
101 GI->setOperand(GI->getPointerOperandIndex(), NewASCToGeneric);
104 auto BI = dyn_cast<BitCastInst>(AllocaUse.getUser());
105 if (BI && BI->getOperand(0) == allocaInst) {
106 BI->setOperand(0, NewASCToGeneric);
116 return new NVPTXLowerAlloca();