[flang][hlfir] add an optimized bufferization pass
This pass is intended to spot cases where we can do better than the default bufferization and to rewrite those specific cases. Then the default bufferization (bufferize-hlfir pass) can handle everything else. The transformation added in this patch rewrites simple element-wise updates to an array to a do-loop modifying the array in place instead of creating and assigning an array temporary. See the RFC at https://discourse.llvm.org/t/rfc-hlfir-optimized-bufferization-for-elemental-array-updates This patch gets the improvement to exchange2 but not the improvement to cam4 described in the RFC. I think the cam4 improvement will require better alias analysis. I aim to follow up to fix this in a later patch. With changes since the RFC, the pass improves polyhedron channel2 by about 52%. Depends on: D156805 D157718 D157626 Differential Revision: https://reviews.llvm.org/D157107
Loading
Please sign in to comment