[PATCH] D86160: [VectorCombine] allow vector loads with mismatched insert type

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 06:43:37 PDT 2020


RKSimon added a comment.

> I'm not sure if we should try to model the cost of the identity shuffle as an insert/extract subvector since we are shuffling with undef?

This came up on PR43605 - we have an insert subvector cost enum but we can't actually create shufflevectors with an insertion pattern - it requires 2 or more shuffles working together - so its tricky to cost it - I'm wondering if we should replace the insert cost enum with something else (concat/lengthen/whatever). We have a similar problem for extract subvector shuffles - we don't have anything that takes elements from one/both sources but is more than just a basic sequential mask. It comes down to what use cases we have here with the VectorCombiner as well as the vectorizers. In short, the shuffle cost enums don't really match what the ir shufflevector can do.



================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:150
+    SmallVector<int, 16> Mask(Ty->getNumElements());
+    std::iota(Mask.begin(), Mask.end(), 0);
+    VecLd = Builder.CreateShuffleVector(VecLd, UndefValue::get(VectorTy), Mask);
----------------
Are we in danger of creating out of bounds shuffle mask indices if the dst vector type is more than 2x the original size (v2f32 -> v16f32 etc.) ? I think they canonicalize to undef but I'm not sure (+ have no access to the source tree atm)


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

https://reviews.llvm.org/D86160



More information about the llvm-commits mailing list