diff options
author | Szymon Piotr Milczek <szymon.milczek@intel.com> | 2025-08-08 15:23:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-08-08 15:23:02 +0200 |
commit | fd41700962d1d078aa0e9bd566ad89d4d53b9607 (patch) | |
tree | b1e6f1b24bf376ece4aa4e0b986e6e2038e86fe5 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 7f0e4079c877cd0c8c6e0172dab52251a4af06d6 (diff) | |
download | llvm-fd41700962d1d078aa0e9bd566ad89d4d53b9607.zip llvm-fd41700962d1d078aa0e9bd566ad89d4d53b9607.tar.gz llvm-fd41700962d1d078aa0e9bd566ad89d4d53b9607.tar.bz2 |
[InstCombine] visitShuffleVectorInst assert with vector of pointers fix. (#152341)
In visitShuffleVectorInst there's an if block that's meant to turn
shufflevector followed by bitcast into extractelement where possible.
It assumes that there will never be bitcasts performed on vectors of ptr
as such operations are almost always illegal, and ptrtoint instructions
should be used instead.
There is however an edge case where a bitcast instruction can be
performed on a vector of type `<1 x ptr>` to turn it into type `ptr`
In this edge case, the code initializes the variable `VecBitWidth` to 0.
Then, when iterating over users that are bitcasts, an attempt is made to
create a vector of size 0, which triggers and assert.
This commit changes initialization of `VecBitWidth` to use datalayout to
find the the size of the vector instead of getPrimitiveSizeInBits method
which results in 0 for ptr and vectors of ptr.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions