Lines Matching defs:fir
21 namespace fir {
24 } // namespace fir
31 /// Return `true` if this allocation is to remain on the stack (`fir.alloca`).
32 /// Otherwise the allocation should be moved to the heap (`fir.allocmem`).
34 keepStackAllocation(fir::AllocaOp alloca,
35 const fir::MemoryAllocationOptOptions &options) {
41 if (auto seqTy = mlir::dyn_cast<fir::SequenceType>(alloca.getInType())) {
42 if (!fir::hasDynamicSize(seqTy)) {
61 static mlir::Value genAllocmem(mlir::OpBuilder &builder, fir::AllocaOp alloca,
71 auto heap = builder.create<fir::AllocMemOp>(alloca.getLoc(), varTy, uniqName,
81 [[maybe_unused]] auto free = builder.create<fir::FreeMemOp>(loc, allocmem);
86 /// This pass can reclassify memory allocations (fir.alloca, fir.allocmem) based
97 : public fir::impl::MemoryAllocationOptBase<MemoryAllocationOpt> {
110 MemoryAllocationOpt(const fir::MemoryAllocationOptOptions &options)
136 auto tryReplacing = [&](fir::AllocaOp alloca) {
145 fir::replaceAllocas(rewriter, func.getOperation(), tryReplacing,
150 fir::MemoryAllocationOptOptions options;