Multiple `func.return` ops inside of a `func.func` op are now supported during bufferization. This PR extends the code base in 3 places: - When inferring function return types, `memref.cast` ops are folded away only if all `func.return` ops have matching buffer types. (E.g., we don't fold if two `return` ops have operands with different layout maps.) - The alias sets of all `func.return` ops are merged. That's because aliasing is a "may be" property. - The equivalence sets of all `func.return` ops are taken only if they match. If different `func.return` ops have different equivalence sets for their operands, the equivalence information is dropped. That's because equivalence is a "must be" property. This commit is in preparation of removing the deprecated `func-bufferize` pass. That pass can bufferize functions with multiple `return` ops.
25 KiB
25 KiB