[llvm] [VectorCombine] foldShuffleOfCastops - handle unary shuffles (PR #160009)

Chaitanya Koparkar via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 06:48:00 PDT 2025


ckoparkar wrote:

The CI is green now. Things to do on this:

1. Whether `bool IsBinaryShuffle = !isa<PoisonValue>(V1);` is okay or should we also check if the second argument is undef/unused. Trying out `isUndefValue` and `ShuffleVectorInst::isSingleSource`.
2. Whether the loop breaking condition is okay `(!IsBinaryShuffle && Opcode == Instruction::BitCast)`.
3. There are already a few tests that show the fold working, but I can add some more to the correct file (shuffle-of-casts.ll). Trying out different examples to see how this works.

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


More information about the llvm-commits mailing list