[PATCH] D102146: [VectorComine] Restrict single-element-store index to inbounds constant

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 05:01:55 PDT 2021


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

LGTM thanks! A but unfortunate the restriction is required, but there’s a few things we can do to improve things, like using ValueTracking to check whether a variable index is in range. But that can be a follow up



================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:805
         !DL.typeSizeEqualsStoreSize(Load->getType()) ||
+        Idx->uge(VecTy->getNumElements()) ||
         SrcAddr != SI->getPointerOperand()->stripPointerCasts() ||
----------------
I think it would be good to update the comment above to reflect all the conditions we check.


================
Comment at: llvm/test/Transforms/VectorCombine/load-insert-store.ll:35
+define void @insert_store_outofbounds(<8 x i16>* %q, i16 zeroext %s) {
+; CHECK-LABEL: @insert_store_outofbounds(
+; CHECK-NEXT:  entry:
----------------
Could you add a test for scalable vectors?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102146



More information about the llvm-commits mailing list