[PATCH] D155520: [LV] Complete load groups and release store groups in presence of dependency

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 13:25:55 PDT 2023


anna added a comment.

Thanks everyone for the review and test cases. I'll try landing this again today.



================
Comment at: llvm/test/Transforms/LoopVectorize/interleaved-accesses-use-after-free.ll:43
+; CHECK: LV: Invalidated store group due to dependence between   store ptr %load7, ptr %getelementptr, align 8 and   store ptr null, ptr %getelementptr13, align 8
+; CHECK-NOT: LV: Invalidated store group due to dependence between
+define void @test(ptr %arg, ptr %arg1) local_unnamed_addr #0 {
----------------
Ayal wrote:
> note: worth clarifying which of the two groups is invalidated (a shortcoming of existing debug prints) - this is checking that exactly one store group is invalidated, due to a dependence between a store of one group and a store of the other. Alternatively, can check the generated scalar stores and shuffles that feed the interleaved store.
Yeah, we'll need to read the source code in line with the debug statement:
```
Invalidated store group due to dependence between   store ptr %load7, ptr %getelementptr, align 8 and   store ptr null, ptr %getelementptr13, align 8
```
A is `store ptr %load7, ptr %getelementptr, align 8`.
We know that the store group being invalidated is the one containing A, which means the store group invalidated is the right one (and dependentInst is not part of that group) :
```
store ptr null, ptr %phi5, align 8
store ptr %load7, ptr %getelementptr, align 8
store ptr %load12, ptr %getelementptr11, align 8
```
I'll add a comment clarifying which store group is invalidated. 

Also, side note: I have a patch which prints out the interleave groups at the end of this analysis. Looks like a generally useful thing to have (especially to make sure the analysis is right, even if we don't end up vectorizing). 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155520/new/

https://reviews.llvm.org/D155520



More information about the llvm-commits mailing list