[Mlir-commits] [flang] [mlir] [RFC][mlir] ViewLikeOpInterface method for detecting partial views. (PR #164020)
Slava Zakharin
llvmlistbot at llvm.org
Mon Oct 27 17:27:02 PDT 2025
================
@@ -212,6 +212,10 @@ AliasResult AliasAnalysis::alias(Source lhsSrc, Source rhsSrc, mlir::Value lhs,
if (lhsSrc.origin == rhsSrc.origin) {
LLVM_DEBUG(llvm::dbgs()
<< " aliasing because same source kind and origin\n");
+ // TODO: we should return PartialAlias here. Need to decide
+ // if returning PartialAlias for fir.pack_array is okay;
+ // if not, then we need to handle it specially to still return
+ // MayAlias.
----------------
vzakhari wrote:
I agree with you, Tom. I think the current algorithm in LocalAliasAnalysis (which I am not trying to affect too much, because this is not my goal) does not allow reasoning about partial aliases quite precisely. So I feel okay returning `MayAlias` in cases where there might be an offset involved. At least, this makes the analysis conservatively correct.
https://github.com/llvm/llvm-project/pull/164020
More information about the Mlir-commits
mailing list