Lines Matching defs:allocmem
140 /// Get fir.allocmem ops which were allocated in this function and always
167 /// Drives analysis to find candidate fir.allocmem operations which could be
173 // Maps fir.allocmem -> place to insert alloca
187 /// Converts a fir.allocmem to a fir.alloca
196 matchAndRewrite(fir::AllocMemOp allocmem,
358 if (auto allocmem = mlir::dyn_cast<fir::AllocMemOp>(op)) {
359 assert(op->getNumResults() == 1 && "fir.allocmem has one result");
368 auto retTy = allocmem.getAllocatedType();
491 // Find all fir.freemem operations corresponding to fir.allocmem
493 // from fir.freemem to fir.allocmem through the def-use chains,
512 fir::AllocMemOp allocmem = freedValue.getDefiningOp<fir::AllocMemOp>();
515 allocmem, allocToFreeMemMap[allocmem]);
517 candidateOps.insert({allocmem, insertionPoint});
560 AllocMemConversion::matchAndRewrite(fir::AllocMemOp allocmem,
564 std::optional<fir::AllocaOp> alloca = insertAlloca(allocmem, rewriter);
571 mlir::Operation *parent = allocmem->getParentOp();
572 // TODO: this shouldn't need to be re-calculated for every allocmem
574 if (lookThroughDeclaresAndConverts(freeOp->getOperand(0)) == allocmem)
584 rewriter, allocmem.getLoc(), allocmem.getResult(), alloca->getResult());
585 rewriter.replaceAllUsesWith(allocmem.getResult(), newValue);
587 // remove allocmem operation
588 rewriter.eraseOp(allocmem.getOperation());
609 // If the old allocmem op was in an openmp region then it should not be moved
645 // block. The best we can do is the location of the allocmem.
653 // there were value operands to the allocmem so insert after the last one
667 // There were no value operands to the allocmem so we are safe to insert it