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

    <tr>
        <th>Summary</th>
        <td>
            [CodeGen][Hexagon] long compilation time with VLIWMachineScheduler
        </td>
    </tr>

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

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

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

<pre>
    The compilation of the example code takes a lot of time in the scheduling pass for Hexagon. In our downstream backend, which use VLIWMachineScheduler it is even worse (85+%), therefore the cause should be in the target independent part.
```
===-------------------------------------------------------------------------===
 Pass execution timing report
===-------------------------------------------------------------------------===
 Total Execution Time: 144.8409 seconds (144.9222 wall clock)

 ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
  74.5014 ( 51.5%)   0.0405 ( 21.3%)  74.5418 ( 51.5%)  74.5774 ( 51.5%)  Machine Instruction Scheduler
  25.3194 ( 17.5%)   0.0118 (  6.2%) 25.3312 ( 17.5%)  25.3545 ( 17.5%)  Hexagon bit simplification
  17.2195 ( 11.9%)   0.0041 (  2.1%)  17.2236 ( 11.9%)  17.2288 ( 11.9%)  Hexagon generate "insert" instructions
  10.9911 (  7.6%)   0.0000 (  0.0%) 10.9911 (  7.6%)  10.9959 (  7.6%)  Hexagon Loop Rescheduling
   8.2689 ( 5.7%)   0.0000 (  0.0%)   8.2689 (  5.7%)   8.2727 (  5.7%)  Hexagon constant-extender optimization
   6.1502 (  4.3%)   0.0161 (  8.5%) 6.1663 (  4.3%)   6.1687 (  4.3%)  Prologue/Epilogue Insertion & Frame Finalization
   0.5480 (  0.4%)   0.0365 ( 19.2%)   0.5845 (  0.4%) 0.5845 (  0.4%)  Hexagon RDF optimizations
   0.4602 (  0.3%)   0.0324 ( 17.1%)   0.4926 (  0.3%)   0.4927 (  0.3%)  Optimize addressing mode of load/store
   0.4537 (  0.3%)   0.0120 (  6.3%)   0.4657 (  0.3%)   0.4658 (  0.3%)  Hexagon DAG->DAG Pattern Instruction Selection
```
[test_long_compilation.zip](https://github.com/llvm/llvm-project/files/12575134/test_long_compilation.zip)

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8Vl1v2zYU_TX0y4UIkiIl8cEPSV13BbqtaLv1saCla4urLAok3aT59QP14dh1imHAsEBIlMPDew_PvaRoQrCHHnFN1D1Rm5U5xdb5dbMPT2bnVjvXfF9_ahFqdxxsZ6J1Pbg9xBYBH81x6NJQgxDNVwxgoHNxHLdHBNuPvFC32Jw62x9gMCHA3nn4BR_NwfUU3vbgTh4a99CH6NEcYWfqr9g3RLyCh9bWLZwCwp_v3n7-1dSt7fHjFA492Ag2AH7DHh6cDwhEVJUi4p4IRYROEWKLHvfO46ikNilWaN2pa2B3FhiNP2AE2zc4YN9gH2EwPlLCNoTdkYLNz_Rvvpme7L_6OUecEsD7ZBI-Yn0a3Y72mKzzODgf_y8Nn1w0Hbw-i_hkj0jyO-BS0koyDQFr1zchWZ4wLYSAB9N1UHeu_prcn5RO4bIs-yOgH8NkWQYAWfbxe4h4nKERSRQi7qeBGcs-p6DneenXb-aI6WWODaWkinGZpIDiVE3VBwBGmWRqxAWn-YInvuTVDT_hZXkbZ-47eJs69FSPfpybcBEhFM25nibz8loEn5NBQcWMJ3rOxQ094UqqG3zeL7CzEYI9Dp3d23rcjYsAXlLB9TyTU30pgEk-CRCUL3jii7y44Y94Vd3gi4ID9uhNTJtN2D6gj0QIsM_ehLMiRrXmc-aSFleKGJtwRtmM_4w-4krf4Iugd84N8AGfT5klP1RUFNU0UdHyH9Jf0a_4FRWlKG_wJX_t-hBNHzN8jOn08OCGtGefrsoDBeWKTQUH-dyMY38U86qrc8ELyosiv2UnvCpv8Pfede5wQiK2rwc7vqZ2RT82KxEFbH3aNVvbm-5HZYwqWZ39kJfK8mJuKH3u3JFfzS16wX8ZPbv0YbO98iVcpJfFYg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