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

    <tr>
        <th>Summary</th>
        <td>
            [LoopDelete] The useless code in the loop should have been removed, but it wasn't
        </td>
    </tr>

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

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

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

<pre>
    Test Case:
```
int test()
{
    long I;
    long A[320] = {1};
    long B[320] = {2};
    long N7 = 320;
    for (I = 0; I < N7; I++)
    {
        A[I] = A[I] + B[I];
        B[I] = A[I] - B[I];
    }
   return 0;
```
The above code is actually useless code in the loop and should be deleted. It has not been deleted yet.

2. How to deal with useless math library function calls in loops?
test case from whteston:
```
#include <math.h>

#define DSIN sin
#define DCOS cos
#define DATAN atan

int test()
{
    double X, Y;
    double T, T2;
    long I;
    T = .499975;
    T2 = 2.0;
    X = 1.0;
    Y = 0.5;
    long N7 = 320;
    for (I = 1; I <= N7; I++)
    {
        X = T *  DATAN(T2 * DSIN(X) * DCOS(X) / (DCOS(X + Y) + DCOS(X - Y) - 1.0));
        Y = T *  DATAN(T2 * DSIN(Y) * DCOS(Y) / (DCOS(X + Y) + DCOS(X - Y) - 1.0));
    }
   return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVVFv4jgQ_jXDy6hRMikkecgDgUWHtOo-FOnKo5MMxCdj92KnqP_-ZAdKgd6u7rSRBZ75xp7P8cwXYa3ca-YSphVMlxMxuM705Xf5t9R_st5PatO-lxu2DhfCMnxbQbWAYg7xEuI5zOLTCKbUDh1bB5QDFaeQrBoniIjK6D2uIb11zWFapRTDdImQLhGyKoFseR9X3cXRl3FPWcB96GdsZ3oEytcB9BD66QKfsjAHqsIoLiuu2PvHM12f818MqgI3b1xl9E_15ZKHrxf445yNnt3Qa7yc4eZ1bzpGUZs3xsa0jNKiaNwglHrHwbJia0-ARtcxKmNeUegWbWcG1WLN2LJix22Ea4edsKiNw5pZnwF8ZxedcodfivAPc0RnsGWh8Chd95HrIFyHSta96N9xN-jGSaOxEUpZT8Gnt5Cuxo18mWAjLOOuNwc8dt5h9M_rCyiVulFDy_7afL6og_TbZ4JAacs7qRmXz-sntFLf-Rc_nrEx9s4_38yfUDihP-_3y5JuzVArxhegBW6vrvKEbDyyofsive6DTSiP6LEoimx6jVCAKLou5pfgTW6827G2o-n_a4rkoym89R_6YmSzQaA5jq8SKPfMaR5uAih_ASpGe_Hj-WKvfPazK3TSdgSqj0B8GH0P4bhU-HHbZdtfE9jeENj-NgI_79oz-FHNk7ZM2yItxITLZFYUsziNM5p0ZVpwTTSdJZTksyRNqGgfdzwTcVvP0iKniSwppjRJkjjOptmUohkXtBN5nWZN3sQ1wWPMByFVpNTbITL9fiKtHbjMkrzIJ0rUrGzQeiLNRwwgEHnp70u_5qEe9hYeYyWts5ddnHQqfCS-G_O6DOrgVcxL0L9qzUlnOvHGo6r0fDBv3PqGqAeH0uFRWA2UucnQq7JzzivEHGgFtNpL1w111JgD0MrzOP09vPbmL24c0Cqwt0CrcLp_AgAA__9SecOW">