[llvm] [InstCombine] visitShuffleVectorInst assert with vector of pointers fix. (PR #152341)

Szymon Piotr Milczek via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 7 03:12:47 PDT 2025


smilczek wrote:

> We can still fold this pattern into `extractelement <3 x ptr> %vptr, i64 0`. It would be better to fix the VecBitWidth calculation than to bail out on pointer vector types. `unsigned VecBitWidth = SrcTy->getPrimitiveSizeInBits().getFixedValue();` -> `unsigned VecBitWidth = DL.getTypeSizeInBits(SrcTy);` Can you test if this change works?

@dtcxzyw It seems to work, however wouldn't that alter the behavior? For example, for a vector <3 x i32> getPrimitiveSizeInBits will return 96, while datalayout should return 128. Could multiplying `SrcElemBitWidth * SrcNumElems` to get VecBitWidth be a more reliable approach?

https://github.com/llvm/llvm-project/pull/152341


More information about the llvm-commits mailing list