================
@@ -1108,6 +1108,113 @@ class ReductionMaskConversion : public 
mlir::OpRewritePattern<Op> {
   }
 };
 
+class EvaluateIntoMemoryAssignBufferization
+    : public mlir::OpRewritePattern<hlfir::EvaluateInMemoryOp> {
+
+public:
+  using mlir::OpRewritePattern<hlfir::EvaluateInMemoryOp>::OpRewritePattern;
+
+  llvm::LogicalResult
+  matchAndRewrite(hlfir::EvaluateInMemoryOp,
+                  mlir::PatternRewriter &rewriter) const override;
+};
+
+static bool mayReadOrWrite(mlir::Region &region, mlir::Value var) {
----------------
tblah wrote:

Please could you add documentation explaining that the side effects you are 
interested in cannot be modeled by `mlir::MemoryEffectOpInterface`. Without 
that information this function is surprising because it is checking mlir memory 
effect interfaces but without using the read or write effects from that 
interface (instead using the alias analysis to determine memory effects).

Maybe we need something in the name to make is clear this uses the high-cost 
high-precision model as a fallback when more precision is needed than just 
querying the mlir memory effects. Perhaps `mayReadOrWriteAA`.

https://github.com/llvm/llvm-project/pull/118069
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to