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

    <tr>
        <th>Summary</th>
        <td>
            [AArch64] Redundant conditional jump instruction when if and for use same condition
        </td>
    </tr>

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

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

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

<pre>
    * test: https://godbolt.org/z/9EGWbrc6e (the source of  [#53625](https://github.com/llvm/llvm-project/issues/53625) is simplified here)
```
int exclusion(int i, int j, int *mask) {
  int m;

  // we can see that condition nex_group already guard in statement for
  if (nex_group) {  // generate smarter assemble with if (1)
    for (m = 0; m < nex_group; m++) {
      if (mask[i] & ex1_bit[m] && mask[j] & ex2_bit[m]) return 1;
    }
  }

  return 0;
}
```
* For above case, as the condition of **for** and **if** is same (variable nex_group),so they have same function. while the clang generate different assemble, so the conditional jump instruction **cbz     w8, .LBB0_7** is redundant for exclusion.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVD-TqzYQ_zRLsxMPXowNBYU5P9KkSpPyRsBidAHJIwn77n36zGIM71KkiIcZr1b7__fTKu_11TAXkJaQXiI1hd664t61XRfVtv0qgM4Y2AdIztiHcPOQnIEqoOpq29oOYWfdFaj6CVTlP37_q3bNkRF-VFC-QZaFntHbyTWMtkOUNJSkyZFSSC9A2b9C6tBP9a6xI1A1DPfX3283Zz-4CUCV9n5iD1Q9g1CO2qPX423QneYWe3b8yp5DfIH4DMd4-eajNgH5sxkmr60ByuSsgd5QhI-XAHQelf9bEsCpfHrifDNCspxf2mfx-GBslEHPjKFXARtrWh20NWj48_3q7HRDNThW7RdeJ-Va1AZ9UIFHNgE769Y0HQJlq9dSxJroyoadCox-VC6wQ-U9j_XA-NChX7z3QPkrHkpwUY4IyQVjSEoU8W2rbFYBlfP3rWf5PUPOA0lLDekFgY7In_v3WgdIy3FRiXax-tis6BcrCe44TM7gfh2kpIDTZZ3nS3wpFod4m_xq8R1bYWtlHara3gUNz4Kn8ig83PCw0o4Yy8xnAZVpF53uFpUQS42_kPmunFYy5m1qK9MW4c1byfWFvbrz072bTCNZd_jo9cDPUgZlrhuOre46dkKCF5JS9jPUVrYa8GMab6iND26aYy4lN_XPGaZHJn67P8oyfj9tXThuJ9OqJ8c27u-itkjaPMlVxMX-mB0yytOcor5QDacdxfkpPShKmdJ9dqprarPmEKdZ20a6oJiSOKUkzvbJnnZ5tpdbig8qVo1K4RDzqPSwk-crKyKaH25xpOyUR4OqefDz0iEy_MD5EohkB7lifvL1dPVwiAftg9-iBB2GeVudz67pjwch2Z9re_85qkfPRogsSMscJr8AtHpFkxuK_7-R5t7-CQAA__-JoJwv">