93 mlir::Operation *scopeOp = this->getOperation();
95 auto &dataLayoutAnalysis = this->
template getAnalysis<mlir::DataLayoutAnalysis>();
96 const mlir::DataLayout &dataLayout = dataLayoutAnalysis.getAtOrAbove(scopeOp);
97 auto &dominance = this->
template getAnalysis<mlir::DominanceInfo>();
101 for (mlir::Region ®ion : scopeOp->getRegions()) {
102 if (region.getBlocks().empty()) {
106 mlir::OpBuilder builder(®ion.front(), region.front().begin());
108 mlir::SmallVector<mlir::PromotableAllocationOpInterface> allocators;
109 region.walk([&](AllocOpTy allocator) { allocators.emplace_back(allocator); });
112 mlir::tryToPromoteMemorySlots(allocators, builder, dataLayout, dominance)
119 this->markAllAnalysesPreserved();