<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/114191>114191</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [InstCombine] miscompilation of `or` of vector
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bongjunj
      </td>
    </tr>
</table>

<pre>
    Alive2 report: https://alive2.llvm.org/ce/z/xEbYKg

```llvm
----------------------------------------
define <2 x i32> @or_sext_to_sel_constant_vec.2(<2 x i1> %y) {
#0:
  %sext = sext <2 x i1> %y to <2 x i32>
  %#1 = or <2 x i32> %sext, { 0, 1 }
 %#2 = sdiv <2 x i32> { 42, 4294967289 }, %#1
  %#3 = udiv exact <2 x i32> %#2, %#2
  %#4 = or <2 x i32> %#2, %#2
  ret <2 x i32> %#4
}
=>
define <2 x i32> @or_sext_to_sel_constant_vec.2(<2 x i1> %y) {
#0:
  ret <2 x i32> { 4294967254, 7 }
}
Transformation doesn't verify!

ERROR: Value mismatch

Example:
<2 x i1> %y = < #x1 (1), #x0 (0) >

Source:
<2 x i32> %sext = < #xffffffff (4294967295, -1), #x00000000 (0) >
<2 x i32> %#1 = < #xffffffff (4294967295, -1), #x00000001 (1) >
<2 x i32> %#2 = < #xffffffd6 (4294967254, -42), #xfffffff9 (4294967289, -7) >
<2 x i32> %#3 = < #x00000001 (1), #x00000001 (1) >
<2 x i32> %#4 = < #xffffffd6 (4294967254, -42), #xfffffff9 (4294967289, -7) >

Target:
Source value: < #xffffffd6 (4294967254, -42), #xfffffff9 (4294967289, -7) >
Target value: < #xffffffd6 (4294967254, -42), #x00000007 (7) >

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VkGPqzYQ_jXDxUpkj50QDhx2N4tU9VBpX1Wpp8iASbwCHNmGZvvrKwPJhmy2r3rVPisiBs8338znMYN0Tu9bpVJYPcJqG8nOH4xNc9PuX7v2NcpN-ZY-1LpXSKw6GuuBP5CD90cH_AEwA8zksLys675ZGrsHzAoFmP0NmJ2e8z9_3QPdAn2Yrms6_oL5-GjxH8doXapKt4oAf0JyIpoj8GcCghq7c-rkd97snKp3hWmdl63f9apYIuDmDGCDPa7eABMC8eMUFnIaEhpuSFgPzgjwLZkmN2jizTyGKyggZwPU2Ns4R7-AT4Ga0DBhBOLthB7BOPKWur-Fx49EYAAJTESyjnGTDOjgb-Sdh8EHT13wpE6y8B_DCXTvcJzDxadZfAKz6j6FmFQ-Jwp8e5Hsp2zoncAGLUcVVyLkEr9vxGXyu5Wtq4xtpNemJaVRrgWMPemV1dUbILsu7ueXl99ewgH5Q9adIo12jfTFYWZyks2xVpfQPhZWkBx4kJafGAHcMMBk1JqfaHhAh0zP-o3Xb6azxUe3s7Kbua6mERyedUhWgWcxI5zGHd47-8z-B8Ul13-nwDsU5fqaYtzNRTgoF44pkuTabjOsLuLvUvIZ5W24P5aG-OI0xuqVdq_8pSjGGiF9KM5QpV_GPvL-ONEkZRzs7uX1rWsaad-uzjclhbFWFZ742Yl1ZwNGdPsdE0oqqWtVLrxZHK3p1eeGU0dU1hrrbhpbVKa8THgiI5WymFOMBaM8OqRVonBF17xCSWklElGJGBmTcl3mvKgw0ilSDMaUxoIJvozzZCU2RVkl1YZLJkBQ1UhdX3ptpJ3rVMqYYAmLapmr2g2tHLFVf5FhFRBDZ7dpAC3ybu9A0Fo7797deO3r4Rvgl9b5J9PkulWw2oY3WGGao67H15-pCKypsbCmYd6rwhsbdbZO518Ee-0PXb4sTAOYDY1-_AuyvqrCA2ZDaA4wm2LvU_wnAAD__6-TMuI">