[flang-commits] [flang] [Flang] Propogate fir.declare attributes through cg-rewrite (PR #137207)
via flang-commits
flang-commits at lists.llvm.org
Fri Apr 25 07:54:19 PDT 2025
================
@@ -281,6 +281,20 @@ class DeclareOpConversion : public mlir::OpRewritePattern<fir::DeclareOp> {
matchAndRewrite(fir::DeclareOp declareOp,
mlir::PatternRewriter &rewriter) const override {
if (!preserveDeclare) {
+ auto memrefOp = declareOp.getMemref().getDefiningOp();
----------------
jeanPerier wrote:
I find it a bit weird to propagate the attributes on the declare memref input producing op. First of all, you may end-up in weird situations where a single alloca maps to several declare (looking at you equivalences), so that could conflict.
Why do you need to propagate attribute if the cg declare is not emitted?
It looks like to me that if one wants to preserve language level info, the declare should also be preserved.
https://github.com/llvm/llvm-project/pull/137207
More information about the flang-commits
mailing list