<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60398>60398</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unnecessary CGSCC runs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
aeubanks
</td>
</tr>
</table>
<pre>
```
$ cat /tmp/a.ll
define void @f() {
br i1 true, label %end, label %never
never:
call void @g()
br label %end
end:
ret void
}
define void @g() {
call void @f()
ret void
}
$ opt -passes='cgscc(simplifycfg)' -S /tmp/a.ll -debug-pass-manager |& grep SimplifyCFGPass
Running pass: SimplifyCFGPass on f (4 instructions)
Running pass: SimplifyCFGPass on f (1 instruction)
Running pass: SimplifyCFGPass on g (2 instructions)
Running pass: SimplifyCFGPass on g (2 instructions)
```
SimplifyCFG should only run on `g` once. There's something going on with which SCCs/RefSCCs we're enqueuing when splitting the `(f, g)` SCC into separate trivial SCC per function.
I believe this is an unintentional side effect of https://reviews.llvm.org/D121953, reverting that fixes this
https://reviews.llvm.org/D129600 likely mitigates this in practice.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVN2uozYQfhpzM0pkBgLhgouziVj1rtrTPoAxA7jr2NQ_SfP2lQk9e7L90elKyIwZfz9jmxHeq8kQtezwiR3OmYhhtq4VFHthvvqst8O9ZRXfHn5m_IVhCVIEYNiFy8KwE3utH6mBRmUIrlYNwEo-MjwybIDVnx55gN6ByiG4SAxPoEVPGhgeyAxPc0NXcg_MIyxe_mKQQus3hemhsOV698y4fk3BN7SjsIK3UurzFvyT_env9p_Exyfxf6XGEuwSYLcI78mz4sywlpOXkuHRq8ui1XiX45SYsIbd6_PGwm6gPk4rencRRkzkgNUnhhVMjhZ43ShO3eefhfcP0S_RGGUmSChWvHy_CKyBERgeS1DGBxdlUNb4t2I-Cs_fw_8Pekpo_GHx_4J_f1vX8R0H-NlGPYA1-g4umsTHKj6xioM1kvbwy0yOGNYevL1QmJOZyabRGripMMNtVnKG19PJM-y-0JgiuCWMIyDze6SYlt9mMuAXrUJI0zBTUmJ4HNNlX0-84okGlAkWPC3CiUAQnLoqodfMQg7GaNYi9-9L-gl60oquBGFWHpQHYSAaZQKZtFho8GogoHEkGcCOMIewpB1l2DHsHF0V3fxe6-tlb93EsDvnmDeHIplz6a_bXIsAo_qD_Cr03sJHCJuKc9DqK-k7XFRQkwgbEygDixMyKEn7bGiLoSkakVGbV_Uhx6I68Gxu8-FYUjk2Ugw4jEhlUdVC9CikHJuBMFMtcix4XuSc8xqbfd9IPpSU542omiEfWMnpIpR-M5Yp7yO1FS-aY7Y2DL_2P0RDN1iTDDG1Q9cmzK6Pk2cl18qHb-VlQQVN7a_GkCTvhbvD6XM6MReNz6LT7fP2TCrMsd9Le2HYJZLttVuc_Y1kYNit0ulKrdb-DAAA__8m275U">