File tree Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -281,20 +281,6 @@ class DeclareOpConversion : public mlir::OpRewritePattern<fir::DeclareOp> {
281281 matchAndRewrite (fir::DeclareOp declareOp,
282282 mlir::PatternRewriter &rewriter) const override {
283283 if (!preserveDeclare) {
284- auto memrefOp = declareOp.getMemref ().getDefiningOp ();
285- if (!memrefOp) {
286- rewriter.replaceOp (declareOp, declareOp.getMemref ());
287- return mlir::success ();
288- }
289-
290- // attach metadatas from the fir.declare to its memref (if it's an
291- // operation)
292- mlir::NamedAttrList elidedAttrs =
293- mlir::NamedAttrList{memrefOp->getAttrs ()};
294- for (const mlir::NamedAttribute &attr : declareOp->getAttrs ())
295- if (!elidedAttrs.get (attr.getName ()))
296- memrefOp->setAttr (attr.getName (), attr.getValue ());
297-
298284 rewriter.replaceOp (declareOp, declareOp.getMemref ());
299285 return mlir::success ();
300286 }
Original file line number Diff line number Diff line change @@ -61,10 +61,5 @@ func.func @test_local_memref() {
6161 %1 = fir.declare %0 {uniq_name = "local_array_declare", acc.declare = #acc.declare<dataClause = acc_create>} : (!fir.ref<!fir.array<10xi32>>) -> !fir.ref<!fir.array<10xi32>>
6262 return
6363}
64- // NODECL-LABEL: func.func @test_local_memref() {
65-
66- // Note: the uniq_name is not attached of fir.declare is not preserved because it conflicts with the uniq_name of the memref
67- // NODECL: fir.alloca{{.*}}{acc.declare = #acc.declare<dataClause = acc_create>, uniq_name = "local_array"}
68-
6964// DECL-LABEL: func.func @test_local_memref() {
7065// DECL: fircg.ext_declare{{.*}}{acc.declare = #acc.declare<dataClause = acc_create>, uniq_name = "local_array_declare"}
You can’t perform that action at this time.
0 commit comments