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

    <tr>
        <th>Summary</th>
        <td>
            Missed optimization of tautological assignment of a global variable
        </td>
    </tr>

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

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

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

<pre>
    Consider the following code:

```c++
unsigned long long value;

void foo() {
 if (value == 4){
        value = 4; 
 }
}
```
https://godbolt.org/z/azYWWboba

Clang doesn't detect a tautological assignment, which can be optimized out.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0UkuPnDAM_jXmYu0oJOF14NDZEbeeVz0mxECqgFckzKr76ytg9qFKjSzn8fn1OTYx-nEhaqG4QnHLzJYmXluzJpozy-5P-8xL9I5WTBPhwCHwm19G7NkRqB8gbiA-dClO6UFedzlet-XI4DDwMp7qbsJGoK7fne_sHQ7MIGuQDUL1QNEPCLI-XBDUDdQNNcjmy-CxPi1Qg7riA4Tq9sjyefio8rxOKb3GnYjsQHYjO8shXXgdQXbvIDvz_uvlxbI134t9DmYZ0THFBWSV0FGiPqHBZLbEgUffm4Bnb2daEshnfJt8P2FvFrSE_Jr87N_JIW_pcgbNXKtcoxqTUZuXdaVEUSudTW3ZC6pVTk1OptS51UWjaBiGgSxVyuaZb6WQSpQyF0KoQl-0retCauFUURSVbkALmo0PlxDu804u8zFu1JZK500WjKUQjwmQcqE3PECQch-Itd19nuw2RtAi-JjiV5TkU6D2p49xZ3JyMsnzgjz8rxc7ZHAMbE3Au1m9sYGybQ3tP1_h07TZS88zyG7P-NieXlf-TX0C2R11RpDdweNvAAAA__9g_dmA">