<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64244>64244</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[regression] extra option -ffast-math bring in inefficient assembly output
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vfdff
</td>
</tr>
</table>
<pre>
test (simplified from #62820): https://gcc.godbolt.org/z/jv4Kzj9rY
```
double **vatom;
void ev_tally(int i, int j, int nlocal, int newton_pair,
double evdwl, double ecoul, double fpair,
double delx, double dely, double delz)
{
double evdwlhalf,ecoulhalf,epairhalf,v[6];
v[0] = delx*delx*fpair;
v[1] = dely*dely*fpair;
v[2] = delz*delz*fpair;
v[3] = delx*dely*fpair;
v[4] = delx*delz*fpair;
v[5] = dely*delz*fpair;
vatom[i][0] += 0.5*v[0];
vatom[i][1] += 0.5*v[1];
vatom[i][2] += 0.5*v[2];
vatom[i][3] += 0.5*v[3];
vatom[i][4] += 0.5*v[4];
vatom[i][5] += 0.5*v[5];
}
```
Now, the clang enable `-ffp-contract=on` default, and it have efficient assembly output.
Then, I try with extra option `-ffast-math`, it has some regression.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEVEGP6jgM_jXuxQKFNC3toQcYFmm10p72sqentHVpRmmCmrTz4NevUsq-zgBvECI2_T5_tutYOqdOhqiAZA_JIZKDb21fjE3dNFFp60vhyXmEP46wf4Msc6o7a9UoqrHpbYfA45RnnN0BOcQ7bL0_O4h3wI_Aj6eqWp9sXVrt17Y_AT9egR_fR_HX9T3v_wV2ALaDlM3fya3tUGpC4Dvgu1F620G8n5HT72hVjTT-8FLrC_BMGY8K-BsG4_1uGG0rqf_36MNb8-MsVQ_87RYH588sSGP9MeHvfmWHpd_8jlyT_rnA1hQyW7pX4PlcxHZ_D7FUbqVugL9Nqnc7KM72CMk-heTwpReI4QGD5IAQH-Y0dvNxyzjeL6GbBfRyg15eQPkCer1Bry-g8WMCr6KKR-irqMljro_Qz91AvE1MslehWffW8H0Iw9ZJGKn534XYA2vzlLX5hsWfsvg3rPgpK_6GJZ6yxDes5Ckr-TRX28PTa_m3_QgT7VvCSktzQjJyuqcpWzXNeVVZ43tZeYgP1kDKsKZGDtoHkjQ1Ko-tHAmpaVSlyHiUzlFX6gvawZ8Hv77p_NOSCZw_0fcX_FC-Rfrpe4n27JU1OAtK51ed9G3IL9zxEN2hsx1hT6eenFPWrKO6iOs8zmVExSbN2Xab5ZmI2mLTVNtNldeCp1vGy4YJVmVpuaUq4ZmkLFIFZzxm23jDhMiFWNeJbEoSQuaUZEQJCEadVHqt9diF5RYp5wYqUsGFiLQsSbv7Zu2LAFqVw8mBYFo5737RvPJ62sG_8g5v6VPRi4Kx7JU5oTKozMteRkOviy-rWPl2KNeV7YAfg_h8rM69fafKAz9OBTjgx6mG_wIAAP__7yzBoA">