Lines Matching refs:box

27                                    const fir::MutableBoxValue &box,  in createNewFirBox()  argument
33 return builder.createConvert(loc, box.getBoxTy(), addr); in createNewFirBox()
58 if (auto charTy = box.getEleTy().dyn_cast<fir::CharacterType>()) { in createNewFirBox()
61 auto bt = box.getBaseTy(); in createNewFirBox()
69 } else if (box.isDerivedWithLenParameters()) { in createNewFirBox()
74 return builder.create<fir::EmboxOp>(loc, box.getBoxTy(), cleanedAddr, shape, in createNewFirBox()
98 const fir::MutableBoxValue &box, in MutablePropertyReader() argument
100 : builder{builder}, loc{loc}, box{box} { in MutablePropertyReader()
101 if (forceIRBoxRead || !box.isDescribedByVariables())
102 irBox = builder.create<fir::LoadOp>(loc, box.getAddr());
107 auto memrefTy = box.getBoxTy().getEleTy(); in readBaseAddress()
112 auto addrVar = box.getMutableProperties().addr; in readBaseAddress()
125 const auto &mutableProperties = box.getMutableProperties(); in readShape()
134 if (box.hasNonDeferredLenParams()) in readCharacterLength()
135 return box.nonDeferredLenParams()[0]; in readCharacterLength()
139 const auto &deferred = box.getMutableProperties().deferredParams; in readCharacterLength()
150 auto rank = box.rank(); in readShape()
165 if (box.isCharacter()) in read()
167 else if (box.isDerivedWithLenParameters()) in read()
180 auto rank = box.rank(); in getLowerBounds()
188 fir::MutableBoxValue box; member in __anone969b6080111::MutablePropertyReader
196 const fir::MutableBoxValue &box) in MutablePropertyWriter() argument
197 : builder{builder}, loc{loc}, box{box} {} in MutablePropertyWriter()
205 if (box.isDescribedByVariables()) in updateMutableBox()
215 assert(!box.isDescribedByVariables()); in updateWithIrBox()
216 builder.create<fir::StoreOp>(loc, newBox, box.getAddr()); in updateWithIrBox()
221 if (box.isDescribedByVariables()) { in setUnallocatedStatus()
222 auto addrVar = box.getMutableProperties().addr; in setUnallocatedStatus()
237 builder, loc, box.getBoxTy(), box.nonDeferredLenParams()); in setUnallocatedStatus()
238 builder.create<fir::StoreOp>(loc, deallocatedBox, box.getAddr()); in setUnallocatedStatus()
244 if (!box.isDescribedByVariables()) in syncMutablePropertiesFromIRBox()
250 MutablePropertyReader{builder, loc, box, /*forceIRBoxRead=*/true}.read( in syncMutablePropertiesFromIRBox()
257 if (!box.isDescribedByVariables()) in syncIRBoxFromMutableProperties()
262 auto addr = MutablePropertyReader{builder, loc, box}.read(lbounds, extents, in syncIRBoxFromMutableProperties()
272 createNewFirBox(builder, loc, box, addr, lbounds, extents, lengths); in updateIRBox()
273 builder.create<fir::StoreOp>(loc, irBox, box.getAddr()); in updateIRBox()
285 const auto &mutableProperties = box.getMutableProperties(); in updateMutableProperties()
302 if (box.isCharacter()) in updateMutableProperties()
309 else if (box.isDerivedWithLenParameters()) in updateMutableProperties()
314 fir::MutableBoxValue box; member in __anone969b6080111::MutablePropertyWriter
365 auto box = in createTempMutableBox() local
368 MutablePropertyWriter{builder, loc, box}.setUnallocatedStatus(); in createTempMutableBox()
369 return box; in createTempMutableBox()
374 static bool readToBoxValue(const fir::MutableBoxValue &box, in readToBoxValue() argument
378 if (box.isDescribedByVariables()) in readToBoxValue()
382 if ((box.isDerived() && mayBePolymorphic) || box.isUnlimitedPolymorphic()) in readToBoxValue()
386 if (box.isAllocatable() || box.rank() == 0) in readToBoxValue()
390 return !fir::valueHasFirAttribute(box.getAddr(), in readToBoxValue()
396 const fir::MutableBoxValue &box, in genMutableBoxRead() argument
398 if (box.hasAssumedRank()) in genMutableBoxRead()
403 if (readToBoxValue(box, mayBePolymorphic)) { in genMutableBoxRead()
404 auto reader = MutablePropertyReader(builder, loc, box); in genMutableBoxRead()
407 box.nonDeferredLenParams()}; in genMutableBoxRead()
412 MutablePropertyReader(builder, loc, box).read(lbounds, extents, lengths); in genMutableBoxRead()
413 auto rank = box.rank(); in genMutableBoxRead()
414 if (box.isCharacter()) { in genMutableBoxRead()
428 const fir::MutableBoxValue &box) { in genIsAllocatedOrAssociatedTest() argument
429 auto addr = MutablePropertyReader(builder, loc, box).readBaseAddress(); in genIsAllocatedOrAssociatedTest()
448 const fir::MutableBoxValue &box) { in genFinalization() argument
449 auto addr = MutablePropertyReader(builder, loc, box).readBaseAddress(); in genFinalization()
465 const fir::MutableBoxValue &box, in associateMutableBox() argument
468 MutablePropertyWriter writer(builder, loc, box); in associateMutableBox()
494 if (box.isDescribedByVariables()) { in associateMutableBox()
516 builder.create<fir::ReboxOp>(loc, box.getBoxTy(), arr.getAddr(), in associateMutableBox()
535 const fir::MutableBoxValue &box, const fir::ExtendedValue &source, in associateMutableBoxWithRemap() argument
567 MutablePropertyWriter writer(builder, loc, box); in associateMutableBoxWithRemap()
587 if (box.isDescribedByVariables()) { in associateMutableBoxWithRemap()
613 builder.create<fir::ReboxOp>(loc, box.getBoxTy(), arr.getAddr(), in associateMutableBoxWithRemap()
632 const fir::MutableBoxValue &box) { in disassociateMutableBox() argument
633 MutablePropertyWriter{builder, loc, box}.setUnallocatedStatus(); in disassociateMutableBox()
638 const fir::MutableBoxValue &box, mlir::ValueRange lenParams) { in getNewLengths() argument
641 if (auto charTy = box.getEleTy().dyn_cast<fir::CharacterType>()) { in getNewLengths()
643 if (box.hasNonDeferredLenParams()) { in getNewLengths()
645 builder.createConvert(loc, idxTy, box.nonDeferredLenParams()[0])); in getNewLengths()
661 const fir::MutableBoxValue &box, in allocateAndInitNewStorage() argument
665 auto lengths = getNewLengths(builder, loc, box, lenParams); in allocateAndInitNewStorage()
667 loc, box.getBaseTy(), allocName, lengths, extents); in allocateAndInitNewStorage()
668 if (box.getEleTy().isa<fir::RecordType>()) { in allocateAndInitNewStorage()
673 mlir::Value irBox = createNewFirBox(builder, loc, box, newStorage, in allocateAndInitNewStorage()
682 const fir::MutableBoxValue &box, in genInlinedAllocation() argument
687 auto lengths = getNewLengths(builder, loc, box, lenParams); in genInlinedAllocation()
691 auto heap = builder.create<fir::AllocMemOp>(loc, box.getBaseTy(), allocName, in genInlinedAllocation()
693 MutablePropertyWriter{builder, loc, box}.updateMutableBox( in genInlinedAllocation()
695 if (box.getEleTy().isa<fir::RecordType>()) { in genInlinedAllocation()
700 mlir::Value irBox = fir::factory::getMutableIRBox(builder, loc, box); in genInlinedAllocation()
707 const fir::MutableBoxValue &box) { in genInlinedDeallocate() argument
708 auto addr = MutablePropertyReader(builder, loc, box).readBaseAddress(); in genInlinedDeallocate()
710 MutablePropertyWriter{builder, loc, box}.setUnallocatedStatus(); in genInlinedDeallocate()
715 const fir::MutableBoxValue &box, mlir::ValueRange shape, in genReallocIfNeeded() argument
719 auto reader = MutablePropertyReader(builder, loc, box); in genReallocIfNeeded()
726 if (box.hasRank()) { in genReallocIfNeeded()
732 if (box.isCharacter()) { in genReallocIfNeeded()
733 auto len = box.hasNonDeferredLenParams() ? reader.readCharacterLength() in genReallocIfNeeded()
735 if (box.hasRank()) in genReallocIfNeeded()
739 if (box.isDerivedWithLenParameters()) in genReallocIfNeeded()
741 if (box.hasRank()) in genReallocIfNeeded()
768 if (box.isCharacter() && !box.hasNonDeferredLenParams()) { in genReallocIfNeeded()
775 } else if (box.isDerivedWithLenParameters()) { in genReallocIfNeeded()
790 builder, loc, box, extents, lengthParams, in genReallocIfNeeded()
809 if (shape.empty() && box.rank() != 0) { in genReallocIfNeeded()
819 builder, loc, box, shape, lengthParams, ".auto.alloc"); in genReallocIfNeeded()
836 const fir::MutableBoxValue &box, in finalizeRealloc() argument
842 auto reader = MutablePropertyReader(builder, loc, box); in finalizeRealloc()
844 if (!takeLboundsIfRealloc && box.hasRank()) in finalizeRealloc()
849 if (box.isCharacter()) in finalizeRealloc()
851 if (box.isDerivedWithLenParameters()) in finalizeRealloc()
854 auto lengths = getNewLengths(builder, loc, box, lenParams); in finalizeRealloc()
861 MutablePropertyWriter{builder, loc, box}.updateMutableBox( in finalizeRealloc()
876 const fir::MutableBoxValue &box) { in getMutableIRBox() argument
877 MutablePropertyWriter{builder, loc, box}.syncIRBoxFromMutableProperties(); in getMutableIRBox()
878 return box.getAddr(); in getMutableIRBox()
882 const fir::MutableBoxValue &box) { in syncMutableBoxFromIRBox() argument
883 MutablePropertyWriter{builder, loc, box}.syncMutablePropertiesFromIRBox(); in syncMutableBoxFromIRBox()