[llvm] [ValueTracking] Teach isGuaranteedNotToBeUndefOrPoison about splats (PR #163570)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 08:22:11 PDT 2025


================

----------------
david-arm wrote:

I think you can also write a instsimplify test for this patch, i.e.

```
define <4 x i32> @foo(i32 noundef %a) {
  %ins = insertelement <4 x i32> poison, i32 %a, i32 0
  %splat = shufflevector <4 x i32> %ins, <4 x i32> poison, <4 x i32> zeroinitializer
  %splat.fr = freeze <4 x i32> %splat
  ret <4 x i32> %splat.fr
}
```

when run with `opt -p instsimplify -S < foo.ll` and your PR the freeze gets removed. Without your patch the freeze remains.

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


More information about the llvm-commits mailing list