Issue 115575
Summary [VectorCombine] UB triggered after optimization
Labels new issue
Assignees
Reporter bongjunj
    https://github.com/llvm/llvm-project/blob/c93e001ca695e905cb965b36d63f7a348d1dd809/llvm/lib/Transforms/Vectorize/VectorCombine.cpp#L1013-L1031

Alive2 report: https://alive2.llvm.org/ce/z/78CM4x

```llvm
----------------------------------------
define <2 x i8> @sdiv_constant_op1_not_undef_lane.2(i8 %x) {
#0:
  %ins = insertelement <2 x i8> poison, i8 %x, i32 3
  %bo = sdiv <2 x i8> %ins, { 5, 2 }
  ret <2 x i8> %bo
}
=>
define <2 x i8> @sdiv_constant_op1_not_undef_lane.2(i8 %x) {
#0:
  %bo.scalar = sdiv i8 %x, poison
  %bo = insertelement <2 x i8> poison, i8 %bo.scalar, i64 3
 ret <2 x i8> %bo
}
Transformation doesn't verify!

ERROR: Source is more defined than target

Example:
i8 %x = poison

Source:
<2 x i8> %ins = < poison, poison >
<2 x i8> %bo = < poison, poison >

Target:
i8 %bo.scalar = UB triggered!



----------------------------------------
define <2 x i64> @urem_constant_op1_not_undef_lane.2(i64 %x) {
#0:
  %ins = insertelement <2 x i64> poison, i64 %x, i32 4294967295
  %bo = urem <2 x i64> %ins, { 5, 2 }
  ret <2 x i64> %bo
}
=>
define <2 x i64> @urem_constant_op1_not_undef_lane.2(i64 %x) {
#0:
  %bo.scalar = urem i64 %x, poison
  %bo = insertelement <2 x i64> poison, i64 %bo.scalar, i64 4294967295
  ret <2 x i64> %bo
}
Transformation doesn't verify!

ERROR: Source is more defined than target

Example:
i64 %x = poison

Source:
<2 x i64> %ins = < poison, poison >
<2 x i64> %bo = < poison, poison >

Target:
i64 %bo.scalar = UB triggered!


Summary:
  0 correct transformations
  2 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to