<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/111421>111421</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[IR] Add samesign flag to icmp instruction
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:globalisel,
llvm-reduce,
llvm:SelectionDAG,
llvm:ir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
elhewaty
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
elhewaty
</td>
</tr>
</table>
<pre>
As suggested [here](https://discourse.llvm.org/t/rfc-signedness-independent-icmps/81423) we will add the `samesign` flag to the icmp instruction. We can split this into separate tasks:
- [ ] Support the `samesign` flag in the IR (Tokenizer, Parser, as a keyword, ...etc)
- [ ] Update the SCEVExpander.
https://github.com/llvm/llvm-project/pull/111419 may handle the previous two goals.
- [ ] Propagate the flag to the SelectionDAG.
- [ ] Handle the flag in GlobalISel.
- [ ] Teach `llvm-reduce` how to strip this.
I will try to work on these tasks under the guidance of the community if it works for you.
CC @nikic @arsenm @tschuett @dtcxzyw @topperc
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2T4yYQ_TXo0mWVhL-kgw5ee72Z29bOJjkjaEvECFQ0jNf761Mw9s6MkxxysRua1nu8140g0oNF7Nj6E-MczYgXEa6Mc7Y-FCKG0fnuvlv0Tl27HQHFYUAKqICtP43oka0PjDdjCDOx5Y7xI-NHpUm66AlLY16m0vmB8WNg_OhPcpFRlUWihbYKZ7QKbVhoOc3E-LGpV3zJeAsXhIs2BoRSEEYEtqlITJjK2aaCkxEDBJdTqRa0peCjDNrZEv5EkMICzUYHCKMm0DY4IJyFFwEhCDpnvtWBVbffRboSsPUBnuM8Ox_-E1bbnHr6Bow3390Zrf6JnvE9fBWeXiNBIOCM14vzKq3LssQgGW8fwX6fVWY0IjzvP__x-ccsrEJfvqf2Ud5BhzH2pXQT48ek8O1vMXv3F8ok9ByNYfxY1_WqbmESVxiFVeYVZvb4ol0kCBcHgxOGyn_X4at3sxju7N4r_owGs9SH3Zfysey3N6i7XF-M64V5ekbzj9PfUcgxyZyv4FFFiUnp0V0SGgWv52zhB5JPr80R_DUdujh_BpddoZu5EJOKmcQQtRJWIrhTXks3TdHqcAV9Ah1yNcHJebi6-AFlvwe2qqw-a5mCZK6dUhRIjhFDSLEK8sfP6yVvu3lGLwEK1S1Vu2xFgV295c2SN822KsZuc-qb9abtZb3tey5azpd9VdWnvkWFlWgL3fGKr-qq2tYtr-uqFKpZYdVs-_Wm6VctslWFk9Dm12wVmihil7zmdWFEj4ZuQ52bY7kbsvqa0KTp5vtb5i72-z223L339jGn_e198F3-Qh8HYqvKaAr0RijoYPK78vQtObxTCu4z9KuLHme2iN50_7vP89Xp1um8Ll46_ncAAAD__zYoiiM">