[llvm] [DA] Add check for base pointer invariance (PR #148241)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 17 05:08:18 PDT 2025
================
@@ -113,7 +113,7 @@ define void @banerjee1(ptr %A, ptr %B, i64 %m, i64 %n) nounwind uwtable ssp {
; CHECK-NEXT: Src: %2 = load i64, ptr %arrayidx6, align 8 --> Dst: store i64 %2, ptr %B.addr.12, align 8
; CHECK-NEXT: da analyze - confused!
; CHECK-NEXT: Src: store i64 %2, ptr %B.addr.12, align 8 --> Dst: store i64 %2, ptr %B.addr.12, align 8
-; CHECK-NEXT: da analyze - output [* *]!
----------------
kasuga-fj wrote:
> `*B++` should be fine though, right?
Yes, I think.
> Should the condition possibly be loop invariant _or_ addrec for the appropriate loop?
Probably yes, but I'm not quite sure what qualifies as an "appropriate loop". In this case, the SCEV value for `%B.addr.12` is `{%B.addr.06,+,8}<nuw><%for.body3>` rather than something like `{{%B,+,(8 * %m)}<%for.cond1.preheader>,+,8}<%for.body3>`. Can we infer anything from the former SCEV representation?
https://github.com/llvm/llvm-project/pull/148241
More information about the llvm-commits
mailing list