[llvm-branch-commits] [VectorCombine] Fix miscompile caused by collisions in foldShuffleToIdentity (PR #188668)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 27 03:55:20 PDT 2026


wangleiat wrote:

> Hi - this is what the Uses is meant to fix, but if there are multiple unsimplified shuffles it looks like it can still have multiple uses that are both identity and splat. This sounds like it should work but is quite expensive to keep. The original would re-calculate if the value was a splat or identity. Could we change it to store a `pair<Value *FrontV, Value *From>`, that stores where the splat / identity is from? I can provide a patch if that would be more useful.

Thanks for the suggestion — that makes sense.

I’m not very familiar with this part of the code, so it would be great if you could provide a patch.

Also, just for context, this issue only shows up on `LoongArch`; other targets don’t seem to trigger it due to the cost model. It exists in 22.x and later versions.

Thanks again!

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


More information about the llvm-branch-commits mailing list