[Mlir-commits] [flang] [mlir] [RFC][mlir] ViewLikeOpInterface method for detecting partial views. (PR #164020)
Matthias Springer
llvmlistbot at llvm.org
Mon Oct 27 17:55:55 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,
----------------
matthias-springer wrote:
What if the offsets are dynamically zero? How can you guarantee this?
```
/// Return true iff the input and the resulting views start
/// at the same address.
```
https://github.com/llvm/llvm-project/pull/164020
More information about the Mlir-commits
mailing list