Lines Matching defs:memref
37 /// Given a memref value, return the "base" value by skipping over all
80 /// Checks if `memref` may potentially alias a MemRef in `otherList`. It is
82 /// aliasing memref in order to perform the desired simplification.
84 ValueRange otherList, Value memref) {
86 if (distinctAllocAndBlockArgument(other, memref))
89 analysis.isSameAllocation(other, memref);
102 /// Remove values from the `memref` operand list that are also present in the
106 /// may-aliasing memref. This is necessary because the `dealloc` operation is
107 /// defined to return one `i1` value per memref in the `retained` list which
109 /// aliasing values in the `memref` list. In particular, this means that if
111 /// the `memref` list (but can only be staticaly determined to may-alias) and M
137 /// The passed 'memref' must not have a may-alias relation to any retained
138 /// memref, and at least one must-alias relation. If there is no must-aliasing
139 /// memref in the retain list, we cannot simply remove the memref as there
143 LogicalResult handleOneMemref(DeallocOp deallocOp, Value memref, Value cond,
147 // Check that there is no may-aliasing memref and that at least one memref
153 analysis.isSameAllocation(retained, memref);
163 // values to incorporate the condition of the must-aliasing memref such that
168 analysis.isSameAllocation(retained, memref);
190 for (auto [memref, cond] :
193 if (succeeded(handleOneMemref(deallocOp, memref, cond, rewriter)))
197 memref.getDefiningOp<memref::ExtractStridedMetadataOp>())
202 newMemrefs.push_back(memref);
217 /// any memref in the `memrefs` list. The corresponding result value can be
222 /// %0:2 = bufferization.dealloc (%m : memref<2xi32>) if (%cond)
223 /// retain (%r0, %r1 : memref<2xi32>, memref<2xi32>)
229 /// bufferization.dealloc (%m : memref<2xi32>) if (%cond)
276 /// simpler dealloc operations. A memref can be split off if it is guaranteed to
277 /// not alias with any other memref in the `memref` operand list. The results
283 /// %0:2 = bufferization.dealloc (%m0, %m1 : memref<2xi32>, memref<2xi32>)
285 /// retain (%r0, %r1 : memref<2xi32>, memref<2xi32>)
293 /// %0:2 = bufferization.dealloc (%m0 : memref<2xi32>) if (%cond0)
294 /// retain (%r0, %r1 : memref<2xi32>, memref<2xi32>)
295 /// %1:2 = bufferization.dealloc (%m1 : memref<2xi32>) if (%cond1)
296 /// retain (%r0, %r1 : memref<2xi32>, memref<2xi32>)
316 Value memref = deallocOp.getMemrefs()[i];
320 // Check if `memref` can split off into a separate bufferization.dealloc.
321 if (potentiallyAliasesMemref(analysis, otherMemrefs, memref)) {
322 // `memref` alias with other memrefs, do not split off.
323 remainingMemrefs.push_back(memref);
328 // Create new bufferization.dealloc op for `memref`.
329 auto newDeallocOp = rewriter.create<DeallocOp>(loc, memref, cond,
335 // Fail if no memref was split off.
362 /// Check for every retained memref if a must-aliasing memref exists in the
363 /// 'memref' operand list with constant 'true' condition. If so, we can replace
364 /// the operation result corresponding to that retained memref with 'true'. If
374 /// retain (%arg0, %arg1 : memref<2xi32>, memref<2xi32>)
378 /// %0:2 = bufferization.dealloc (%arg2 : memref<2xi32>) if (%true)
379 /// retain (%arg0, %arg1 : memref<2xi32>, memref<2xi32>)
395 for (auto [memref, cond] :
404 analysis.isSameAllocation(retained, memref);
415 memref.getDefiningOp<memref::ExtractStridedMetadataOp>();
429 newMemrefs.push_back(memref);