Title: Automatic Instruction Scheduler Retargeting by Reverse-Engineering
1Automatic Instruction Scheduler Retargeting by
Reverse-Engineering
- Matthew J. Bridges, Neil Vachharajani, Guilherme
Ottoni, David I. August - Liberty Research Group
- Department of Computer Science
- Princeton University
2Structural Hazards
Code
Resources
Add
ALU1
ALU0
Time
Shl
ALU1
ALU0
Sub
ALU1
ALU0
Xor
3Structural Hazards
Code
Resources
Add
ALU1
ALU0
Shl
Time
ALU1
ALU0
Sub
ALU1
ALU0
Xor
4Encoding Structural Hazards
- Processor Manuals
- Pros
- Easily Available
- Standard Methodology
- Cons
- Processor manual does not describe the actual
machine - Takes several man-weeks to translate processor
manual into machine description - Machine description written incorrectly
Processor Manuals
Offline
Compiler
Machine Description
Hazard Detector
Scheduler
5Processor Manuals
IA64 Instructions Set Reference Vol. 3 370
pages of ISA description
Itanium 2 Processor Reference Manual200 pages
of microarchitecural details
6Humans arent Perfect
IMPACT Itanium 2 Machine Description
OP_SHIFT (alt(ALT_SHIFT_REG)) OP_SHIFT
(alt(ALT_SHIFT_IMM))
ALT_SHIFT_REG (format (OF_IREG_IREG
resv(RL_Itype))
ALT_SHIFT_IMM (format (OF_IREG_IMM6
resv(RL_Itype))
Itanium Instruction Set Reference Vol. 3 Page
3212
Itanium 2 Processor Reference Manual Page 27
7Encoding Structural Hazards
- Architecture Description LanguageLISAnML
- Pros
- Machine description accurately describes
processor - Cons
- ADLs are limited
- Not used for general purpose processors
- Often unavailable
ADL
Offline
Compiler
Machine Description
Hazard Detector
Scheduler
8Encoding Structural Hazards
- Query machine while scheduling
- Baker 91Dupre 04
- Pros
- Avoids human errors
- Easily available
- Cons
- Increase in compile time
- Unable to cross-compile
Hazard Detector
Scheduler
Compiler
9Encoding Structural Hazards
- Query machine a priori
- Pros
- Avoids human errors
- Easily available
- Avoid scheduling overhead
- Cons
- ?
Hazard Detector
Scheduler
Machine Description
Compiler
Offline
Structural HazardDetermination Algo.
10Limits of Querying
Goal Perfectly characterize the machine
Goal Characterize the machine
Machine A
Machine B
Finite
Finite
Infinite
Infinite
11Identifying a Subspace to Explore
Possible Instruction Schedules
Itanium 2
Time
Assumption
General
100 Schedules/Second
12Cost of Assumptions
13Reverse-Engineering Algorithm
1. All Instructions in a Single Category
14Cost of Finding Categories
15Conclusion
- Obtaining structural hazards for use in
instruction scheduling is error prone - Processors manuals wrong or confusing
- Manual translation is error prone
- ADLs arent available
- We can automatically extract structural hazards
useful for scheduling - It is impossible to determine all structural
hazards a priori - It is possible to find sufficient hazard
information to produce good schedules - Algorithm achieves 81-100 of manual resource map
performance - Greatly reduces the time needed to retarget the
instruction scheduler of a compiler - Facilitates Design Space Exploration
16Thank You