[Mlir-commits] [flang] [mlir] [flang][acc] Introduce interface for rematerializable ops (PR #174467)
Razvan Lupusoru
llvmlistbot at llvm.org
Mon Jan 5 11:45:40 PST 2026
================
@@ -61,6 +61,18 @@ void registerOpenACCExtensions(mlir::DialectRegistry ®istry) {
*ctx);
fir::TypeDescOp::attachInterface<
IndirectGlobalAccessModel<fir::TypeDescOp>>(*ctx);
+
+ // Attach OutlineRematerializationOpInterface to FIR operations that
+ // produce synthetic types (shapes, field indices) which cannot be passed
+ // as arguments to outlined regions and must be rematerialized inside.
+ fir::ShapeOp::attachInterface<
----------------
razvanlupusoru wrote:
After starting to investigate I see some non-tractable concerns that make this interface too general for my intended purpose. Effectively, I plan on using this interface to allow movement of some operations into acc regions which cannot be passed as arguments (and even if they can, it is not a good idea because they are important for completeness of another operation).
The problem with relying on Pure is that this is attached to many operations including math operations (such as many operations in arith, complex, index, vector dialects) and many memref operations. The heuristics for moving such operations will be different (for example we may choose to do all invariant arithmetic on host before launch), and thus my intended algorithm to move just the operations critical for composing another would not work well in this scenario. Thus, I do not think I can use your suggestion. Do you see something I may have missed?
https://github.com/llvm/llvm-project/pull/174467
More information about the Mlir-commits
mailing list