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

    <tr>
        <th>Summary</th>
        <td>
            LoopVectorizer Fails to Vectorize Loops with slt but Works with sgt Despite Logical Equivalence
        </td>
    </tr>

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

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

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

<pre>
    As the title states. I have a loop that vectorize with the condition 

`icmp slt i32 %inc, %dec`

but doesn't with 

`icmp sgt i32 %dec, %inc`

although they are logically the same.

Reproducer vectorization succeed:

https://compiler-explorer.com/z/MzaGzWeWa

Reproducer vectorization fails:

https://compiler-explorer.com/z/hPofjKK3G




</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyckk9vnDwQxj-NuYyyMmb5d_Ah75sSVWmlKofmPNgTcGowtc2m2U9fGTZbtZdKlSwBwzM_Zh4eDMEMM5Fk5X-svMtwjaPz8tHNdzjinPM8651-k7cB4kgQTbQEIWKkcICPMOKJAME6t0AcMcKJVHTenAleTRy3HuVmbaJxMzB-m07FjZoWCDaCKQQwUZpZMfF_utOkWMV3Yb9G0I7CzEQdd94fhOFKSH07IbHeCWjj6NZhm-MN0BNYNxiF1r5towWc6LBLH2nxTq-K_HUH3IYOq1JEmhW3u3CMcQnpSXRMdMpNi7Hkb-jHYp0nf1BuYqI7M9F9PuP9-Yme8C9feEZjwz_wxy_u-eXhobi_uLKdTMtCt0WLGcm8LqqiqNuyzUaJ-NwiFVV7LMq6PVZYVjova2yP-bFpdJ0ZKbgoec6bXPCybA-50E3fNJUSirjQBTtymtDYg7Wn6eD8kJkQVpK5EDnnmcWebNiCJMRMr7C9ZUKkXHmZmm76dQjsyK0JMfzCbKmSn5xbvr7Hx0OXXIHo4FqDpAh7EFJ4Uj6enP_2Xhoi3FFYTEzK7TfDh--rOaGlWVG2eit_N3cwcVz7i6NpmsvlZvHuhVRkott2CEx0lyVPUvwMAAD__5xECKQ">