[all-commits] [llvm/llvm-project] fd4170: [InstCombine] visitShuffleVectorInst assert with v...
Szymon Piotr Milczek via All-commits
all-commits at lists.llvm.org
Fri Aug 8 06:23:23 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fd41700962d1d078aa0e9bd566ad89d4d53b9607
https://github.com/llvm/llvm-project/commit/fd41700962d1d078aa0e9bd566ad89d4d53b9607
Author: Szymon Piotr Milczek <szymon.milczek at intel.com>
Date: 2025-08-08 (Fri, 08 Aug 2025)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
A llvm/test/Transforms/InstCombine/2025-08-06-shufflevector-bitcast-vector-of-pointers.ll
Log Message:
-----------
[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.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list