#include "flang/Optimizer/Builder/HLFIRTools.h"
#include "flang/Optimizer/Dialect/FIRDialect.h"
#include "flang/Optimizer/Dialect/FIROps.h"
#include "flang/Optimizer/Support/Utils.h"
#include "flang/Optimizer/Transforms/Passes.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "flang/Optimizer/Transforms/Passes.h.inc"
|
#define | GEN_PASS_DEF_OPTIMIZEARRAYREPACKING |
#define | DEBUG_TYPE "optimize-array-repacking" |
This pass removes redundant fir.pack_array operations, if it can prove that the source array is contiguous. In this case, it relink all uses of fir.pack_array result to the source. If such a rewrite happens, it may turn the using fir.unpack_array operation into one with the same temp and original operands - these are also removed as redundant.