[PATCH] D145616: [LV] Use speculatability within entire loop to avoid strided load predication

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 09:36:38 PST 2023


anna added a comment.

AFAICT, the only thing which prevented us from figuring out dereferencability for strided loads (i.e. accesses with gaps) was identifying the correct `AccessSize`. So, that's basically the patch.



================
Comment at: llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll:1023
 ; CHECK-NEXT:    [[TMP63:%.*]] = insertelement <4 x i1> [[TMP62]], i1 [[TMP59]], i32 3
 ; CHECK-NEXT:    [[TMP64:%.*]] = getelementptr i32, ptr [[ALLOCA]], i64 [[TMP0]]
 ; CHECK-NEXT:    [[TMP65:%.*]] = getelementptr i32, ptr [[ALLOCA]], i64 [[TMP4]]
----------------
One thing I noticed is that we drop the `inbounds` on GEPs when we converted the masked loads to unmasked versions (perhaps because we cannot prove if the `inbounds` is correct without the predication?). We do not do the same "dropping of inbounds" when we removed predication for the strided case.  Any idea why is that? It looks like we should be dropping on the strided case, but I don't know the LV code well enough to see where this is done and what is missing. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145616



More information about the llvm-commits mailing list