[Mlir-commits] [flang] [mlir] [RFC][mlir] ViewLikeOpInterface method for detecting partial views. (PR #164020)
Slava Zakharin
llvmlistbot at llvm.org
Mon Oct 27 18:04:53 PDT 2025
================
@@ -3032,6 +3032,15 @@ void SubViewOp::build(OpBuilder &b, OperationState &result, Value source,
/// For ViewLikeOpInterface.
Value SubViewOp::getViewSource() { return getSource(); }
+bool SubViewOp::isSameStart() {
+ // TODO: we can recognize simple constant operands.
+ if (!getOffsets().empty())
+ return false;
+ ArrayRef<int64_t> staticOffsets = getStaticOffsets();
+ return llvm::all_of(staticOffsets,
----------------
vzakhari wrote:
As in the reply above, the comment should probably say:
```
/// Return true iff the input and the resulting views **are known to** start
/// at the same address.
```
Does that look better?
https://github.com/llvm/llvm-project/pull/164020
More information about the Mlir-commits
mailing list