[flang-commits] [flang] [mlir] [RFC][mlir] ViewLikeOpInterface method for detecting partial views. (PR #164020)
Matthias Springer via flang-commits
flang-commits at lists.llvm.org
Fri Oct 31 21:20:29 PDT 2025
================
@@ -23,21 +23,53 @@ def ViewLikeOpInterface : OpInterface<"ViewLikeOpInterface"> {
}];
let cppNamespace = "::mlir";
- let methods = [
- InterfaceMethod<
- "Returns the source buffer from which the view is created.",
- "::mlir::Value", "getViewSource">,
- InterfaceMethod<
- /*desc=*/[{ Returns the buffer which the view created. }],
- /*retTy=*/"::mlir::Value",
- /*methodName=*/"getViewDest",
- /*args=*/(ins),
- /*methodBody=*/"",
- /*defaultImplementation=*/[{
+ let methods =
+ [InterfaceMethod<
+ "Returns the source buffer from which the view is created.",
+ "::mlir::Value", "getViewSource">,
+ InterfaceMethod<
+ /*desc=*/[{ Returns the buffer which the view created. }],
+ /*retTy=*/"::mlir::Value",
+ /*methodName=*/"getViewDest",
+ /*args=*/(ins),
+ /*methodBody=*/"",
+ /*defaultImplementation=*/[{
return $_op->getResult(0);
- }]
- >
- ];
+ }]>,
+ InterfaceMethod<
+ /*desc=*/
+ [{
+ Returns true iff the source buffer and the resulting view
+ are known to start at the same "address".
+ }],
+ /*retTy=*/"bool",
+ /*methodName=*/"isKnownToHaveSameStart",
----------------
matthias-springer wrote:
Can `isKnownToHaveSameStart` and `isKnownToBeCompleteView` be replaced by a single interface method that returns `AliasResult::Kind`?
https://github.com/llvm/llvm-project/pull/164020
More information about the flang-commits
mailing list