Issue 119900
Summary [VectorCombine] vectorizeLoadInsert - incorrect shuffle when folding from inserting into undef vector
Labels llvm:transforms, miscompilation:undef
Assignees RKSimon
Reporter RKSimon
    As mentioned here by @nunoplopes: https://discourse.llvm.org/t/please-dont-use-undef-in-tests-part-2/83388/17?u=rksimon
```
; Transforms/VectorCombine/X86/load.ll

define <4 x float> @load_f32_insert_v4f32(ptr dereferenceable(16) align(16) %p) {
  %s = load float, ptr dereferenceable(16) align(16) %p, align 16
  %r = insertelement <4 x float> undef, float %s, i32 0
  ret <4 x float> %r
}
=>
define <4 x float> @load_f32_insert_v4f32(ptr dereferenceable(16) align(16) %p) {
  %#1 = load <4 x float>, ptr dereferenceable(16) align(16) %p, align 16
  %r = shufflevector <4 x float> %#1, <4 x float> poison, 0, 4294967295, 4294967295, 4294967295
  ret <4 x float> %r
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Source value: < poison, #x00000000 (+0.0), #x00000000 (+0.0), #x00000000 (+0.0) >
Target value: < poison, poison, poison, poison >
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to