Commit 892ac61
Add HexagonGlobalScheduler pass (#180803)
This patch adds the HexagonGlobalScheduler, a post-packetization pass
that performs global instruction scheduling and pull-up optimizations to
improve packet density on Hexagon VLIW architecture.
The scheduler operates on scheduling regions (super-blocks with single
entry and multiple exits) and attempts to move instructions across basic
blocks to fill packet slots more efficiently. It supports both
speculative and predicative scheduling modes.
Key features:
- Global instruction scheduling across basic blocks
- Speculative scheduling with safety checks
- Predicative scheduling using predication
- Local pull-up within basic blocks
- Dual jump formation
- Branch optimizations
- Liveness preservation using HexagonLiveVariables
The pass depends on HexagonLiveVariables and HexagonGlobalRegion
infrastructure for maintaining correct liveness information when moving
instructions across basic block boundaries.
This patch also adds two helper functions to HexagonRegisterInfo that
are required by the scheduler to prevent correctness issues.
1. isGlobalReg(MCPhysReg Reg) - Returns true for reserved physical
registers (R29, R30, R31) that are live across function calls. This
prevents the scheduler from incorrectly speculating instructions that
modify the stack pointer or frame pointer.
2. isFakeReg(MCPhysReg Reg) - Returns true for fake HVX registers
(VF0-VF31, VFR0-VFR31) used as sub-registers in vector pairs. This
prevents crashes when the scheduler processes HVX vector operations by
skipping these internal bookkeeping registers.
The scheduler runs in the pre-emit pipeline after packetization and is
only active when optimizations are enabled.
Patch by Sergei Larin <slarin@qti.qualcomm.com>
Co-authored-by: Ikhlas Ajbar <iajbar@qti.qualcomm.com>
Co-authored-by: Krzysztof Parzyszek <kparzysz@codeaurora.org>1 parent 637e9bd commit 892ac61
File tree
16 files changed
+7711
-4
lines changed- llvm
- lib/Target/Hexagon
- test/CodeGen/Hexagon
- autohvx
16 files changed
+7711
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
0 commit comments