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

    <tr>
        <th>Summary</th>
        <td>
            clang is suboptimal for `abs(b * a * a)` when b is a specific constant
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Test case:
https://godbolt.org/z/Go83o39ff
```cpp
#include<cmath>

int foo(int a)
{
   return abs(3 * a * a);
}

int bar(int a)
{
   return 3 * a * a;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMUk3O2yAQPc14gxLB4N8Fi6Spe4FegD_btNhYgPupPX1lO1HVdFMJDQPz5on3BpmSGxdrBVR3qB6F3PIUovh-kTGGj1SoYH6KrzZlomWywG9AH0BvU85r2k_YA_ZjMCr4fA1xBOx_AfZfQssD74bhhENNz6XX9XmD3C3ab8YC_6RnmSfgn5-lI7olkyEEwHbPJGD3rDb3MyGERJu3uBCpEmDLCeCNyDPucH5_dTzeiZWM_0P8N-W_fC9VhRHcdLyThRWsoRVjNVZNMQnWqVJJHKyhvB24lVSVWg-l6WpjmFGFE0ixpIxxyrFkzXVou5pVNW1UU3Z1I6GkdpbOX73_Me8GFy6lzYqmpawtvFTWp2N2iNrLZQTEfYxR7PiL2sYEJfUu5fSHIbvsrTjgxCWSNhXW7GbpyRAigZqehqp3Q2tKPia7ELV3SZJWq93gNNFhSVkuudiiF28_w-VpU1cdZsB-f8Bzu6wxfLM6A_aHngTYH5J-BwAA___3Rb1C">