[Mlir-commits] [flang] [mlir] [RFC][mlir] ViewLikeOpInterface method for detecting partial views. (PR #164020)
    Slava Zakharin 
    llvmlistbot at llvm.org
       
    Mon Oct 20 11:15:48 PDT 2025
    
    
  
vzakhari wrote:
Thank you for the comments, Jean and Razvan.
Regarding `SubviewLikeOpInterface`, I think the same operation may present a `complete view` and a `partial view` depending on its operands' values.  This is why I would prefer the have a single interface and let the operations' implementations decide whether it is complete or partial view depending on the operands.
I thought a bit more about this, and I think that for aliasing analysis we should only care about the beginning of the input and result buffers. For example, if the initial view is `(ptr1, size1)`, and the resulting view is `(ptr1, size2)`, then we should actually report `MustAlias`. The fact that the `size1` may be bigger than `size2` should not affect the alias analysis.
Maybe, it is worth having the following two methods in the `ViewLikeOpInterface`:
1. `isSameStart` - same definition as in this PR.
2. `isCompleteView` - returns true iff `isSameStart` is true and the views have the same size.
https://github.com/llvm/llvm-project/pull/164020
    
    
More information about the Mlir-commits
mailing list