[flang-commits] [flang] [flang][acc] Implement cache directive lowering (PR #174897)

Razvan Lupusoru via flang-commits flang-commits at lists.llvm.org
Thu Jan 8 09:58:13 PST 2026


================
@@ -86,6 +87,25 @@ struct OutlineRematerializationModel
     : public mlir::acc::OutlineRematerializationOpInterface::ExternalModel<
           OutlineRematerializationModel<Op>, Op> {};
 
+/// External model to implement FortranVariableOpInterface for acc::CacheOp.
+struct CacheFortranVariableModel
+    : public fir::FortranVariableOpInterface::ExternalModel<
+          CacheFortranVariableModel, mlir::acc::CacheOp> {
+  mlir::Value getBase(mlir::Operation *op) const {
+    return mlir::cast<mlir::acc::CacheOp>(op).getAccVar();
----------------
razvanlupusoru wrote:

`AccVar` is the result of the cache operation - is this what you intended? Or the original variable?

https://github.com/llvm/llvm-project/pull/174897


More information about the flang-commits mailing list