<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/69574>69574</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Simplification for `(-a * b) / (a * b)` and `(-a + b) / (a - b)`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
The following two functions can be evaluated as true.
```cpp
bool f(int a, int b)
{
return (-a * b) / (a * b);
}
bool g(int a, int b)
{
return (-a + b) / (a - b);
}
```
https://godbolt.org/z/sa5nTd9ob
https://alive2.llvm.org/ce/z/c5EBFp
GCC and MSVC can simplify the function `f`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycUk2PmzAQ_TXDZRRkhu8Dh3yUnnraVe_G2MStg5FtEm1_fQVhm2jVVaVKSIzG8_zm-T3uvR5GKRvID5CfIj6Hs3XNzx13zt581Nn-rXk9S1TWGHvT44DhZlHNowjajh4FH7GTKK_czDzIHrnH4GYZAzsB20PB7p-Ypnuns9agAqr0GJADHXEpOqB6Q5SHe4GITobZjQhU7TgC7dcxBGqX1qMD6eEde9qKB9XwX1SHD1S7z4je9T3znkOYPKR7oBaoHWzfWRNi6wag9hdQ63k-vva17f42zo2-SoqNuV42iJAbTuRfDu30zPT1eEQ-9vjt5ftxtcLry2S0esOweLa5hFAwBQWLo75J-zqteSSbpKjLkhVFStG5kUmiZFGxShETVZ1QxbOqLJXoqlRRl0W6IUZpwpKa1QlLKU6oyvM6U7Lui16wHDImL1ybP4tH2vtZNkWdl1lkeCeNX0NGNMobrodAtGTONQtm182Dh4wZ7YN_3BJ0MLJ5ucvSgq96lHWLpn_momDr6zyNfuJrwaLZmeaDcTqc5y4W9gLULgttv93k7A8pAlC7yvBA7SrzdwAAAP__AlDvIw">