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

Chaitanya Koparkar via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 04:22:20 PDT 2025


ckoparkar wrote:

> You might be stuck in a loop with foldBitcastShuffle?

You're absolutely right, foldBitcastOfShuffle and foldShuffleOfCastops keep changing the same two instructions back and forth and are stuck in an infinite loop.

What would your suggestion be to fix this? I don't have a feel for which of these folds is preferable. I could add a check in foldShuffleOfCastops to skip the fold if the instruction is a unary shuffle followed by a bitcast: `shuffle X, poison, mask ; bitcast`.

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


More information about the llvm-commits mailing list